/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: white;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0;
}

header {
    text-align: center;
    margin-bottom: 10px;
}

/* Page Navigation Styles (between different pages) */
.page-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 20px 0 5px 0;
}

.page-nav-button {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    text-decoration: none;
    display: inline-block;
}

.page-nav-button:hover {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #333;
    transform: translateY(-1px);
}

.page-nav-button.active {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    cursor: default;
}

.page-nav-button.active:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* Segmented Control with border (site style) */
.segmented-control {
    display: inline-flex;
    background: transparent;
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 0;
    margin: 0 auto 10px auto;
    position: relative;
    gap: 0;
    overflow: hidden;
}

.segment-button {
    background: transparent;
    border: none;
    border-right: 2px solid #4caf50;
    border-radius: 0;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4caf50;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    white-space: nowrap;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.segment-button:last-child {
    border-right: none;
}

.segment-button:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.segment-button:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.segment-button:hover:not(.active) {
    background: #e8f5e8;
    color: #45a049;
}

.segment-button.active {
    background: #4caf50;
    color: white;
    font-weight: 600;
    cursor: default;
}

.segment-button:disabled {
    background: transparent;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
    border-right-color: #ddd;
}

.segment-button:disabled:hover {
    background: transparent;
    color: #ccc;
}

/* Center the segmented control */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
    margin-top: 0;
}

/* Tab Content Styles */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    margin-top: 0;
    padding-top: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    /* Responsive modal improvements */
    .modal {
        padding: 5px !important;
    }
    
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 5px auto !important;
        max-height: 85vh !important;
    }
    
    .modal-body {
        padding: 10px !important;
    }
    
    .modal-header {
        padding: 8px 10px !important;
    }
    
    .modal-footer {
        padding: 8px 10px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    /* Extra small screen modal improvements */
    .modal {
        padding: 2px !important;
    }
    
    .modal-content {
        width: 98vw !important;
        max-width: 98vw !important;
        margin: 2px auto !important;
        max-height: 95vh !important;
        border-radius: 6px !important;
    }
    
    .modal-body {
        padding: 8px !important;
    }
    
    .modal-header {
        padding: 6px 8px !important;
    }
    
    .modal-header span {
        font-size: 13px !important;
    }
    
    .modal-footer {
        padding: 6px 8px !important;
        flex-direction: column;
        gap: 6px;
    }
    
    .btn {
        width: 100%;
        padding: 10px 16px !important;
    }
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: #7f8c8d;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #3498db;
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Popup Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 350px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    border: 3px solid #4caf50;
    animation: popupAppear 0.15s ease;
    position: relative;
    padding: 0;
    margin: auto;
}

@keyframes popupAppear {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.modal-header span {
    margin: 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.close-btn {
    font-size: 18px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 12px;
}

.modal-body textarea {
    width: 100%;
    min-height: 50px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #4caf50;
}

.modal-footer {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    justify-content: flex-start;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #4caf50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

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

.btn-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-success:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d92 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}
