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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.hidden { display: none !important; }

/* Auth Section */
.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.auth-container h1 { text-align: center; font-size: 2.5rem; margin-bottom: 10px; }
.subtitle { text-align: center; color: #888; margin-bottom: 30px; }

.auth-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1rem;
}

.auth-form input::placeholder { color: #888; }

.auth-form button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.auth-form button:hover { transform: translateY(-2px); }
.switch-auth { text-align: center; margin-top: 20px; color: #888; }
.switch-auth a { color: #667eea; text-decoration: none; }
.error { background: #ff4757; padding: 10px; border-radius: 10px; margin-top: 15px; }

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(0,0,0,0.3);
}

.header-right { display: flex; align-items: center; gap: 15px; }
#user-name { color: #888; }

/* Buttons */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.btn-back {
    background: transparent;
    color: #667eea;
    font-size: 1rem;
}

/* Project Selection */
#project-selection {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#projects-list {
    display: grid;
    gap: 15px;
}

.project-card {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card:hover {
    transform: translateX(5px);
    background: rgba(255,255,255,0.15);
}

.project-card h3 { margin-bottom: 5px; }
.project-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.status-topic { background: #ff6b6b; }
.status-script { background: #feca57; color: #333; }
.status-shot { background: #48dbfb; color: #333; }
.status-completed { background: #1dd1a1; color: #333; }

#new-project-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#new-project-form input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Chat Section */
#chat-section {
    max-width: 900px;
    margin: 0 auto;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.project-info { flex: 1; }
.project-info h2 { margin-bottom: 10px; }

.block-indicators { display: flex; gap: 10px; }
.block-indicator {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    opacity: 0.5;
}

.block-indicator.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 1;
}

.block-indicator.completed {
    background: #1dd1a1;
    opacity: 1;
}

/* Chat Messages */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 20px;
    line-height: 1.5;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.assistant {
    align-self: flex-start;
    background: rgba(255,255,255,0.1);
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

#chat-input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1rem;
    resize: none;
}

#send-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 15px;
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.btn-close {
    background: transparent;
    color: #fff;
    font-size: 1.5rem;
    padding: 5px 10px;
}

#summary-content {
    padding: 20px;
}

#summary-content h3 {
    color: #667eea;
    margin: 20px 0 10px;
}

#summary-content p, #summary-content li {
    color: #ccc;
    line-height: 1.6;
}

#summary-content ul {
    padding-left: 20px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* Shot Table */
.shot-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.85rem;
}

.shot-table th, .shot-table td {
    padding: 10px 8px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: left;
}

.shot-table th {
    background: rgba(102, 126, 234, 0.3);
    color: #fff;
    font-weight: 600;
}

.shot-table td {
    color: #ccc;
    background: rgba(0,0,0,0.2);
}

.shot-table tr:hover td {
    background: rgba(102, 126, 234, 0.1);
}

.btn-primary {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}
