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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-links a:hover {
    background: #ecf0f1;
    color: #2980b9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background: #2980b9;
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

input, select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
}

.auth-form {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.auth-form h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.auth-form p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.form-tabs {
    display: flex;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: #ecf0f1;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tab.active {
    background: #3498db;
    color: white;
}

.form-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-content.hidden {
    display: none;
}

.projects-section, .domains-section, .analytics-section, .api-examples-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.projects-section h2, .domains-section h2, .analytics-section h2, .api-examples-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

#add-project-form, #add-domain-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#add-project-form input, #add-domain-form input {
    flex: 1;
}

.project-item {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.project-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-name {
    font-weight: 500;
}

.domain-item {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.domain-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.domain-name {
    font-weight: 500;
}

.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background: #c0392b;
}

.analytics-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.analytics-controls select {
    flex: 1;
    min-width: 150px;
}

.analytics-header {
    margin-bottom: 25px;
}

.analytics-header h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 24px;
}

.analytics-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.summary-item {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    position: relative;
}

.trend-indicator {
    font-size: 14px;
    font-weight: 600;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.trend-positive {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.trend-negative {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.summary-label {
    display: block;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.analytics-chart {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.chart-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: white;
}

.analytics-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.legend-color.current-period {
    background: #3498db;
}

.legend-color.previous-period {
    background: #aed6f1;
}

.legend-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.analytics-data-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.analytics-data-section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
}

.analytics-data-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
}

.analytics-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.analytics-data-table th {
    background: #e9ecef;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1;
}

.analytics-data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f3f4;
}

.analytics-data-table tr:hover {
    background: #f8f9fa;
}

.url-cell {
    max-width: 300px;
    word-break: break-all;
    font-family: monospace;
    font-size: 12px;
}

.raw-data-section {
    margin-top: 20px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.raw-data-section summary {
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 1px solid #dee2e6;
}

.raw-data-section[open] summary {
    border-bottom: 1px solid #dee2e6;
}

.raw-data-section .analytics-data-table-container {
    border: none;
    border-radius: 0;
}

.message {
    padding: 10px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

/* Verification Instructions */
.verification-instructions {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.verification-instructions.hidden {
    display: none;
}

.verification-instructions h3 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.verification-methods .verification-method {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.verification-methods .verification-method h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.verification-methods .verification-method .verification-example {
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
}

.verification-methods .verification-method .verification-example code {
    color: #ffffff;
    background: transparent;
}

.verification-steps {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.verification-steps ol {
    margin: 10px 0;
    padding-left: 20px;
}

.verification-steps li {
    margin: 8px 0;
    line-height: 1.5;
}

.verification-example {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
    word-break: break-all;
}

.verify-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.verify-btn:hover {
    background: #229954;
}

.close-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.close-btn:hover {
    background: #7f8c8d;
}

.domain-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.domain-status.verified {
    background: #d4edda;
    color: #155724;
}

.domain-status.pending {
    background: #fff3cd;
    color: #856404;
}

/* API Examples Section */
.example-group {
    margin-bottom: 30px;
}

.example-group h3 {
    color: #34495e;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

.code-example {
    margin-bottom: 20px;
}

.code-example h4 {
    color: #7f8c8d;
    margin-bottom: 8px;
    font-size: 14px;
}

.code-example pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.code-example pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.example-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.example-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #7f8c8d;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.example-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.example-tab:hover {
    color: #2980b9;
}

.example-content {
    display: block;
}

.example-content.hidden {
    display: none;
}

#curl-domain, #curl-domain-2, .curl-domain {
    background: #f39c12;
    color: #2c3e50;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .analytics-controls {
        flex-direction: column;
    }
    
    .analytics-summary {
        flex-direction: column;
    }
    
    .analytics-legend {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .chart-image {
        max-width: 100%;
        height: auto;
    }
    
    #add-project-form, #add-domain-form {
        flex-direction: column;
    }
    
    .code-example pre {
        font-size: 11px;
        padding: 10px;
    }
}

/* Loading button animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.button-loading {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.button-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress 1.5s infinite;
}

@keyframes progress {
    0% { left: -100%; }
    100% { left: 100%; }
}