/* Dulfex Web Frontend Styles */

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --background-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --header-bg: #2c3e50;
    --header-text: #ecf0f1;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--background-color);
    color: var(--text-color);
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.app-header nav {
    display: flex;
    gap: 2rem;
}

.app-header nav a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.app-header nav a:hover {
    color: var(--primary-color);
}

/* Main content */
.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Footer */
.app-footer {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.875rem;
}

/* Home page */
.home {
    text-align: center;
}

.home h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.home > p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: #666;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Dashboard */
.dashboard h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.health-status,
.market-view {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.health-status h3,
.market-view h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.health-ok {
    color: var(--secondary-color);
}

.health-error {
    color: var(--danger-color);
}

/* Not found page */
.not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.not-found h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--danger-color);
}

.not-found a {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.not-found a:hover {
    background-color: #2980b9;
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
    text-align: center;
}

.login-card h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-button:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading-text {
    margin-top: 1rem;
    color: #666;
    font-size: 0.875rem;
    font-style: italic;
}

/* Loading spinner styles */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error message styles */
.error-message {
    background-color: #fee;
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--danger-color);
}

.error-message strong {
    display: block;
    margin-bottom: 0.5rem;
}

.error-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 2rem;
    text-align: center;
}

.error-container h2 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.error-container .error-message {
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.retry-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

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

/* Responsive design */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
    }

    .app-main {
        padding: 1rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem;
    }

    .error-actions {
        flex-direction: column;
        width: 100%;
    }

    .error-actions button {
        width: 100%;
    }
}