@import './DesignTokens.css';

/* Theme-Aware Globe View Styles */
.globe-view-container {
    min-height: 100vh;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    padding: var(--spacing-lg);
    margin: 0;
    display: flex;
    flex-direction: column;
    transition: var(--transition-all);
}

.globe-view-container h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    background: linear-gradient(135deg, var(--color-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    box-shadow: var(--shadow-base);
}

/* State containers */
.loading-container,
.error-message,
.no-data-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--spacing-2xl);
    background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-tertiary));
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border-primary);
    box-shadow: var(--shadow-base);
    margin: var(--spacing-lg) 0;
    backdrop-filter: blur(8px);
}

/* Loading spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--color-border-primary);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* Loading text */
.loading-container p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    margin: 0;
}

/* Error message styles */
.error-message {
    background: linear-gradient(135deg, var(--color-danger-light), var(--color-bg-secondary));
    border-left: 4px solid var(--color-danger);
}

.error-message p {
    color: var(--color-danger);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-lg);
    line-height: var(--line-height-normal);
}

.error-message button {
    background: linear-gradient(135deg, var(--color-danger), #c62828);
    color: var(--color-text-primary);
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-base);
    cursor: pointer;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    transition: var(--transition-all);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.error-message button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-base);
}

.error-message button:hover {
    background: linear-gradient(135deg, #c62828, var(--color-danger));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.error-message button:hover::before {
    left: 100%;
}

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

/* No data message styles */
.no-data-message {
    background: linear-gradient(135deg, var(--color-warning-light), var(--color-bg-secondary));
    border-left: 4px solid var(--color-warning);
}

.no-data-message p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    margin: 0;
    line-height: var(--line-height-normal);
}

/* Globe container */
.globe-container {
    flex: 1;
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border-primary);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(8px);
}

.globe-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Controls panel */
.globe-controls {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    z-index: var(--z-overlay);
    min-width: 200px;
}

.control-group {
    margin-bottom: var(--spacing-base);
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.control-input {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--border-radius-base);
    background: var(--color-bg-quaternary);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    transition: var(--transition-base);
}

.control-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-border);
}

/* Info panel */
.globe-info-panel {
    position: absolute;
    bottom: var(--spacing-lg);
    left: var(--spacing-lg);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    z-index: var(--z-overlay);
    max-width: 300px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--color-border-primary);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

.info-value {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .globe-view-container {
        padding: var(--spacing-base);
    }

    .globe-controls {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: var(--spacing-lg);
        width: 100%;
    }

    .globe-info-panel {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: var(--spacing-lg);
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .globe-view-container {
        padding: var(--spacing-base);
    }

    .globe-view-container h2 {
        font-size: var(--font-size-xl);
        padding: var(--spacing-base);
    }

    .loading-container,
    .error-message,
    .no-data-message {
        padding: var(--spacing-lg);
    }

    .globe-controls,
    .globe-info-panel {
        padding: var(--spacing-base);
    }
}

@media (max-width: 480px) {
    .globe-view-container {
        padding: var(--spacing-sm);
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .loading-spinner::after {
        width: 12px;
        height: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner,
    .loading-spinner::after {
        animation: none;
    }

    * {
        transition: none !important;
    }
}

/* Focus states for accessibility */
.error-message button:focus-visible,
.control-input:focus-visible {
    outline: 2px solid var(--color-primary) !important;
    outline-offset: 2px !important;
}