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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navbar Styles */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(30, 41, 59, 0.8);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-back {
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-color);
    font-weight: 500;
    margin-right: 1rem;
}

.btn-back:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-logout {
    padding: 0.5rem 1.5rem;
    background: var(--surface-light);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.btn-logout:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Language Switcher */
.language-switcher {
    display: inline-block;
}

.language-select {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.language-select:hover {
    background-color: var(--surface);
    border-color: var(--primary-color);
}

.language-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 1rem;
}

/* Messages */
.messages {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning);
    color: var(--warning);
}

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

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
    padding: 2rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-help-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.error-message {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Landing Page */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.landing-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.landing-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tools Section */
.tools-section {
    margin-bottom: 4rem;
}

.tools-section:last-child {
    margin-bottom: 0;
}

.tools-section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.tools-section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tools-section-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.tool-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    height: 100%;
}

.tool-card-link-disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.5;
    filter: grayscale(100%);
}

.tool-card-link-disabled .tool-card:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
    border-left-width: 2px;
}

.tool-card-link-disabled .tool-card::before {
    display: none;
}

.tool-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease;
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:nth-child(1) { 
    animation-delay: 0.1s;
    border-left: 4px solid #6366f1;
}
.tool-card:nth-child(2) { 
    animation-delay: 0.2s;
    border-left: 4px solid #8b5cf6;
}
.tool-card:nth-child(3) { 
    animation-delay: 0.3s;
    border-left: 4px solid #10b981;
}
.tool-card:nth-child(4) { 
    animation-delay: 0.4s;
    border-left: 4px solid #f59e0b;
}

.tool-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px var(--shadow-lg);
    border-left-width: 6px;
}

.tool-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tool-card:nth-child(1) .tool-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.tool-card:nth-child(2) .tool-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.tool-card:nth-child(3) .tool-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.tool-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), transparent);
    opacity: 0.3;
}

.tool-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: auto;
    line-height: 1.6;
    flex: 1;
}

.btn-tool {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--surface-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.btn-tool:not(:disabled) {
    cursor: pointer;
}

.btn-tool:not(:disabled):hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-tool:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .btn-back {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .login-card {
        padding: 2rem;
    }
    
    .landing-header h1 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .landing-header h1 {
        font-size: 1.75rem;
    }
}

