/* My AI Chat - Finální styly */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === COLOR SCHEMES === */
:root {
    /* Claude (Default) */
    --primary-color: #C96442;
    --primary-hover: #B45309;
    --secondary-color: #78716C;
    --success-color: #16A34A;
    --warning-color: #EAB308;
    --error-color: #DC2626;
    --background: #FAF9F5;
    --surface: #F0EEE6;
    --surface-hover: #E8E5DD;
    --border: #E2DFD7;
    --text-primary: #2D2A26;
    --text-secondary: #6B6B6B;
    --text-muted: #9CA3AF;
    --shadow-sm: 0 1px 2px 0 rgb(45 42 38 / 0.05);
    --shadow: 0 1px 3px 0 rgb(45 42 38 / 0.1), 0 1px 2px -1px rgb(45 42 38 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(45 42 38 / 0.1), 0 4px 6px -4px rgb(45 42 38 / 0.1);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Google theme */
.theme-google {
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --border: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --success-color: #137333;
    --warning-color: #f29900;
    --error-color: #d93025;
    --background: #ffffff;
    --surface: #f8f9fa;
    --surface-hover: #f1f3f4;
}

/* Replit theme */
.theme-replit {
    --background: #0e1525;
    --surface: #1c2333;
    --surface-hover: #2d3748;
    --border: #3a4553;
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --primary-color: #f56565;
    --primary-hover: #e53e3e;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
}

/* Carrd theme */
.theme-carrd {
    --primary-color: #00d9d9;
    --primary-hover: #00ffff;
    --secondary-color: #ff0080;
    --success-color: #00d084;
    --warning-color: #ffb900;
    --error-color: #ff0080;
    --background: #0d0f11;
    --surface: #1a1d21;
    --surface-hover: #242830;
    --border: #2a2d35;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --shadow-sm: 0 2px 8px rgba(0, 217, 217, 0.1);
    --shadow: 0 4px 16px rgba(0, 217, 217, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 217, 217, 0.3);
    --radius: 0.75rem;
    --radius-lg: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.chat-container {
    width: 100%;
    max-width: 900px;
    height: 95vh;
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* === HEADER === */
.chat-header {
    background: var(--surface);
    color: var(--text-primary);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    min-height: 80px;
    transition: all 0.2s ease;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.header-logo-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-logo-link:hover {
    color: var(--primary-color);
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* === RELOAD BUTTON === */
.index-button {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.index-button:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.index-button:active {
    transform: translateY(0);
}

/* === THEME SELECTOR === */
.theme-selector-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 0.5rem;
}

.theme-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 0;
    background: none;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.theme-btn.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.15);
}

.theme-btn.theme-claude {
    background: linear-gradient(135deg, #FAF9F5 0%, #F0EEE6 100%);
}

.theme-btn.theme-google {
    background: linear-gradient(135deg, #ffffff 0%, #1a73e8 100%);
}

.theme-btn.theme-replit {
    background: linear-gradient(135deg, #0e1525 0%, #f56565 100%);
}

.theme-btn.theme-carrd {
    background: linear-gradient(135deg, #00d9d9 0%, #0d0f11 100%);
}

/* === CHAT MESSAGES === */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--background);
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    max-width: 85%;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 0.925rem;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    margin-right: 0;
    border-bottom-right-radius: 0.25rem;
}

.assistant-message {
    background: var(--surface);
    color: var(--text-primary);
    margin-right: auto;
    margin-left: 0;
    border-bottom-left-radius: 0.25rem;
    border: 1px solid var(--border);
}

.system-message {
    background: rgba(201, 100, 66, 0.1);
    color: var(--primary-color);
    margin: 1rem auto;
    text-align: center;
    width: fit-content;
    max-width: 95%;
    font-style: italic;
    border: 1px solid rgba(201, 100, 66, 0.2);
}

.error-message {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error-color);
    margin: 1rem auto;
    text-align: center;
    width: fit-content;
    max-width: 95%;
    font-weight: 500;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* === WELCOME SCREEN === */
.welcome-container {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    transition: all 0.2s ease;
}

.welcome-content {
    max-width: 600px;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.example-queries {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin: 0;
}

.example-query {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.example-query::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.example-query:hover::before {
    transform: scaleX(1);
}

.example-query:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* === CHAT INPUT === */
.chat-input-area {
    display: flex;
    padding: 1.5rem 2rem;
    background: var(--background);
    border-top: 1px solid var(--border);
    gap: 1rem;
    align-items: flex-end;
}

/* Plynulá animace pro změnu výšky textarea */
.chat-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.925rem;
    resize: none;
    outline: none;
    background: var(--background);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, height 0.1s ease;
    font-family: inherit;
    line-height: 1.6;
    min-height: 2.75rem;
    max-height: 200px;
    color: var(--text-primary);
    overflow-y: hidden;
    display: block;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.1);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.send-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.send-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === APP FOOTER === */
.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.footer-text {
    color: var(--text-secondary);
}

.footer-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.footer-link {
    color: inherit;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Footer link colors per theme */
.footer-link strong {
    color: var(--primary-color);
}

.theme-google .footer-link strong {
    color: var(--primary-color);
}

.theme-replit .footer-link strong {
    color: var(--primary-color);
}

.theme-carrd .footer-link strong {
    color: var(--text-primary);
}

/* === CARRD THEME SPECIFIC STYLES === */
.theme-carrd body {
    background: #000000;
}

.theme-carrd .chat-container {
    border: 1px solid var(--border);
    background: var(--background);
    box-shadow: 0 0 40px rgba(0, 217, 217, 0.1);
}

.theme-carrd .chat-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    padding: 1.5rem 2rem; /* OPRAVENO - stejný padding jako výchozí */
    min-height: 80px;
}

.theme-carrd .chat-header h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-carrd .header-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.theme-carrd .index-button {
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 2rem;
}

.theme-carrd .index-button:hover {
    background: var(--primary-color);
    color: var(--background);
    box-shadow: 0 0 20px rgba(0, 217, 217, 0.5);
    transform: translateY(-2px);
}

.theme-carrd .theme-btn {
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    opacity: 0.7;
}

.theme-carrd .theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    opacity: 1;
}

.theme-carrd .theme-btn.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 217, 217, 0.5);
    opacity: 1;
}

.theme-carrd .chat-messages {
    background: var(--background);
}

.theme-carrd .message {
    border-radius: var(--radius-lg);
    box-shadow: none;
    border: 1px solid var(--border);
}

.theme-carrd .user-message {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--background);
    border: none;
}

.theme-carrd .assistant-message {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.theme-carrd .system-message {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    font-style: normal;
}

.theme-carrd .error-message {
    background: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.theme-carrd .welcome-title {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-carrd .welcome-subtitle {
    color: var(--text-secondary);
}

.theme-carrd .example-query {
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.3s ease;
    border-radius: var(--radius);
}

.theme-carrd .example-query::before {
    display: none;
}

.theme-carrd .example-query:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 217, 217, 0.2);
}

.theme-carrd .chat-input-area {
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.theme-carrd .chat-input {
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text-primary);
    font-family: inherit;
}

.theme-carrd .chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 217, 217, 0.2);
    background: var(--surface);
}

.theme-carrd .send-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--background);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 217, 217, 0.3);
}

.theme-carrd .send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 217, 217, 0.5);
}

.theme-carrd .send-button:disabled {
    background: var(--border);
    color: var(--text-muted);
    box-shadow: none;
}

.theme-carrd .app-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.theme-carrd .footer-text {
    color: var(--text-secondary);
}

.theme-carrd .footer-link strong {
    color: var(--primary-color);
    font-weight: 600;
}

.theme-carrd .footer-link:hover strong {
    color: var(--primary-hover);
    text-shadow: 0 0 10px rgba(0, 217, 217, 0.5);
}

/* === CARRD THEME ANIMATIONS === */
.theme-carrd .message {
    animation: carrdGlowIn 0.5s ease;
}

@keyframes carrdGlowIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-carrd .welcome-container {
    animation: carrdFadeIn 0.6s ease; /* OPRAVENO - zkráceno z 0.8s */
}

@keyframes carrdFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* === CARRD SCROLLBAR === */
.theme-carrd ::-webkit-scrollbar {
    width: 8px;
}

.theme-carrd ::-webkit-scrollbar-track {
    background: var(--background);
}

.theme-carrd ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.theme-carrd ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* === CARRD THEME ANIMATIONS === */
.theme-carrd .message {
    animation: carrdSlideIn 0.4s ease;
}

@keyframes carrdSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }
    
    .chat-header {
        padding: 1rem 1.5rem;
        min-height: 70px;
    }
    
    .chat-header h1 {
        font-size: 1.25rem;
    }
    
    .header-subtitle {
        font-size: 0.8rem;
    }
    
    .index-button {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
    
    .theme-selector-inline {
        gap: 0.25rem;
    }
    
    .theme-btn {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .chat-input-area {
        padding: 1rem 1.5rem;
    }
    
    .example-queries {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .example-query {
        padding: 0.875rem 1rem;
        font-size: 0.8rem;
    }
    
    .message {
        max-width: 90%;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .welcome-container {
        padding: 1rem;
        min-height: 300px;
    }
    
    .welcome-title {
        font-size: 1.25rem;
    }
    
    .welcome-subtitle {
        font-size: 0.9rem;
    }
    
    .app-footer {
        padding: 0.75rem 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .footer-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .theme-btn {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .header-subtitle {
        display: none;
    }
    
    .header-buttons {
        gap: 0.5rem;
    }
    
    .footer-content {
        gap: 0.25rem;
    }
}

/* === UTILITIES === */
.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
