/* Modern Entmix Styles */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container & Layout Updates */
.container {
    max-width: 1600px;
    margin: 24px auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray);
    transition: var(--transition);
    position: relative;
}

.tab-btn:hover:not(.active) {
    background: var(--light-gray);
    color: var(--dark);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

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

.tab-content.active {
    display: block;
}

.header-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Modern Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
    border: 1px solid var(--border);
}

/* Element Grid Modern Style */
.element-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.element-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.element-card:hover::before {
    opacity: 0.1;
}

.element-card:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.element-card.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.element-card .symbol {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.element-card .name {
    font-size: 11px;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

.element-card .atomic-number {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* Results Card Modern Style */
.result-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.result-card:hover {
    transform: translateX(4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.result-card h3 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-card h3::before {
    content: '📊';
    font-size: 20px;
}

/* Input Styles */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

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

/* Modal Modern Style */
.modal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    animation: slideUp 0.3s ease-in-out;
}

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

/* Table Modern Style */
.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.history-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.history-table tr:hover {
    background: var(--light-gray);
    transition: var(--transition);
}

.history-table tr:last-child td {
    border-bottom: none;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d1fae5;
    color: var(--success);
}

.badge-danger {
    background: #fee2e2;
    color: var(--danger);
}

.badge-warning {
    background: #fef3c7;
    color: var(--warning);
}

.badge-info {
    background: #dbeafe;
    color: var(--primary);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Toast notifications are defined in app.html */

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 16px;
    }
    
    .navbar h1 {
        font-size: 20px;
    }
    
    .container {
        padding: 0 16px;
        margin: 16px auto;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .element-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
        gap: 8px !important;
    }
    
    .header-section {
        padding: 16px;
    }
}
