/* Chess Elegante - Analyze Upload Page Styles */

/* Page Title & Subtitle */
.page-title {
    font-size: 48px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.page-subtitle {
    font-size: 16px;
    font-family: 'Helvetica Neue', sans-serif;
    font-weight: 300;
    color: #666;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

/* ============================================
   ANALYZE UPLOAD TRIGGER
   ============================================ */
.analyze-upload-trigger {
    max-width: 1200px;
    margin: 0 auto 50px auto;
    padding: 0 60px;
    text-align: center;
}

.login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.login-prompt p {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #666;
    margin: 0;
}

.btn-analyze {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', sans-serif;
    font-weight: 300;
    background: #1a1a1a;
    color: white;
    border: 1px solid #1a1a1a;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-analyze:hover {
    background: white;
    color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.btn-analyze svg {
    transition: stroke 0.3s;
}

.btn-analyze:hover svg {
    stroke: #1a1a1a;
}

.upload-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
    justify-content: flex-end;
}

.icon-btn {
    position: relative;
    padding: 8px;
    background: white;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.icon-btn:hover svg {
    stroke: white;
}

.icon-btn .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: white;
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    font-family: 'Helvetica Neue', sans-serif;
    letter-spacing: 0.5px;
}

.icon-btn:hover .tooltip {
    opacity: 1;
}

#pgnInput {
    width: 100%;
    padding: 15px;
    border: 1px solid #e8e8e8;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: white;
    color: #1a1a1a;
    resize: vertical;
    margin-bottom: 10px;
    min-height: 250px;
    transition: all 0.2s;
}

#pgnInput:focus {
    outline: none;
    border-color: #1a1a1a;
    background: #fafafa;
}

#pgnInput::placeholder {
    color: #999;
}

.status-message {
    padding: 12px 15px;
    margin-top: 10px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 12px;
    border-left: 3px solid transparent;
}

.status-message.success {
    background: #e8f5e9;
    color: #2d7a2d;
    border-left-color: #2d7a2d;
}

.status-message.error {
    background: #ffebee;
    color: #d32f2f;
    border-left-color: #d32f2f;
}

.status-message.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left-color: #1976d2;
}

/* ============================================
   PGNS SECTION WITH TABS
   ============================================ */
.pgns-section {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 0 60px;
}

.pgns-container {
    background: #fafafa;
    border: 1px solid #e8e8e8;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    background: white;
}

.tab-button {
    flex: 1;
    padding: 20px 30px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', sans-serif;
    font-weight: 300;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    color: #999;
    position: relative;
}

.tab-button:hover {
    color: #1a1a1a;
    background: #fafafa;
}

.tab-button.active {
    color: #1a1a1a;
    background: #fafafa;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #1a1a1a;
}

/* Tab Content */
.tab-content-wrapper {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.pgns-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.pgn-item {
    background: white;
    border: 1px solid #e8e8e8;
    padding: 25px;
    transition: all 0.3s;
    cursor: pointer;
}

.pgn-item:hover {
    border-color: #1a1a1a;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.pgn-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.pgn-info {
    flex: 1;
    cursor: pointer;
}

.pgn-name {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 6px;
    line-height: 1.4;
}

.pgn-date {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 11px;
    color: #999;
    letter-spacing: 0.5px;
}

.pgn-result {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', sans-serif;
    padding: 4px 10px;
    border: 1px solid #1a1a1a;
    background: white;
    color: #1a1a1a;
    white-space: nowrap;
}

.pgn-details {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.pgn-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 6px 0;
}

.pgn-detail-label {
    font-weight: 300;
    color: #999;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pgn-detail-value {
    font-weight: 400;
    color: #1a1a1a;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pgn-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid #e8e8e8;
}

.pgn-action-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e8e8e8;
    background: white;
    color: #1a1a1a;
}

.pgn-action-btn:hover {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

.pgn-action-btn.commentary-btn {
    color: #2d7a2d;
    border-color: #2d7a2d;
}

.pgn-action-btn.commentary-btn:hover {
    background: #2d7a2d;
    color: white;
}

.pgn-action-btn.commentary-btn.has-commentary {
    background: #e8f5e9;
    cursor: default;
}

.pgn-action-btn.commentary-btn.has-commentary:hover {
    background: #e8f5e9;
    color: #2d7a2d;
    border-color: #2d7a2d;
}

.pgn-action-btn.delete-btn {
    color: #d32f2f;
    border-color: #d32f2f;
    flex: 0;
    min-width: auto;
}

.pgn-action-btn.delete-btn:hover {
    background: #d32f2f;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #999;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 14px;
}

.empty-state p {
    margin: 0;
    font-style: italic;
}

/* Curated item styling */
.pgn-item.curated-item {
    border-left: 3px solid #2d7a2d;
}

.pgn-item.curated-item:hover {
    border-left-color: #2d7a2d;
}

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

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-header h3 {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', sans-serif;
    font-weight: 300;
    margin: 0;
}

.close-modal {
    font-size: 24px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #1a1a1a;
}

.modal-body {
    padding: 30px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e8e8e8;
}

.btn-secondary {
    background: white;
    color: #1a1a1a;
    border-color: #e8e8e8;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn-danger {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.btn-danger:hover {
    background: #b71c1c;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1200px) {
    .analyze-upload-trigger,
    .pgns-section {
        padding: 0 30px;
    }

    .pgns-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .page-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }

    .analyze-upload-trigger,
    .pgns-section {
        padding: 0 20px;
    }

    .tab-content-wrapper {
        padding: 20px;
    }

    .tab-button {
        padding: 15px 20px;
        font-size: 11px;
    }

    .pgns-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .pgn-item {
        padding: 20px;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 24px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .analyze-upload-trigger,
    .pgns-section {
        padding: 0 15px;
    }

    .tab-content-wrapper {
        padding: 15px;
    }

    .tab-button {
        padding: 12px 15px;
        font-size: 10px;
    }

    .upload-controls {
        width: 100%;
        justify-content: flex-end;
    }

    #pgnInput {
        min-height: 150px;
    }

    .empty-state {
        padding: 40px 20px;
    }

    .pgn-item {
        padding: 15px;
    }

    .pgn-actions {
        flex-direction: column;
    }

    .pgn-action-btn {
        width: 100%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }

    .btn-analyze {
        padding: 12px 30px;
        font-size: 11px;
    }
}

/* ============================================
   HIGHLIGHT NEW GAME ANIMATION
   ============================================ */
@keyframes highlightPulse {
    0%, 100% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(0, 123, 255, 0.1);
        transform: scale(1.02);
    }
}

.pgn-item.highlight-new {
    animation: highlightPulse 2s ease-in-out;
}
