:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --accent: #22d3ee;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-glass: 1px solid rgba(255, 255, 255, 0.08);
    --chrome: #ff5252;
    --edge: #00c6ff;
    --active-green: #10b981;
    --active-glow: rgba(16, 185, 129, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(34, 211, 238, 0.1) 0%, transparent 20%);
    animation: bgMove 20s infinite alternate;
    z-index: -1;
}

@keyframes bgMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50px, -50px); }
}

.hidden { display: none !important; }

/* Glass Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Auth Screen */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.auth-content {
    text-align: center;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

.auth-content h1 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-family: 'Outfit', sans-serif;
}

.auth-form {
    text-align: right;
}

.auth-form h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.crypto-note {
    margin-top: 25px;
    font-size: 0.8rem !important;
    opacity: 0.7;
    color: var(--text-secondary);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Main App */
.app-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    opacity: 1;
    transition: opacity 0.5s;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-welcome {
    color: var(--accent);
    font-size: 0.9rem;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 10px;
}

.badge-count {
    background: var(--primary);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: bold;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px var(--active-glow); }
    50% { box-shadow: 0 0 20px var(--active-glow), 0 0 30px var(--active-glow); }
}

/* Form Styles */
.add-section {
    padding: 30px;
    margin-bottom: 30px;
}

.add-section h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input, select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Browser Select */
.browser-select-wrapper {
    display: flex;
    gap: 10px;
}

.browser-select-wrapper select {
    flex: 1;
}

.icon-btn-small {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn-small:hover {
    background: var(--primary);
    color: white;
}

/* Date Time Section */
.date-time-section {
    background: rgba(0, 0, 0, 0.15);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.date-time-section h3 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-time-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .date-time-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .date-time-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.date-time-grid input,
.date-time-grid select {
    text-align: center;
    padding: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    float: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: scale(1.02);
}

/* Cards List */
.email-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.email-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(100%);
    transition: transform 0.5s;
}

.email-card:hover::before {
    transform: translateX(-100%);
}

.email-card:hover {
    transform: translateX(-5px);
}

/* Active Date Styling */
.email-card.active-date {
    border-right-color: var(--active-green) !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), var(--bg-card));
    animation: pulse-glow 2s infinite;
}

.email-card.active-date::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--active-green), #059669);
    border-radius: 0 20px 20px 0;
}

.date-badge.active-date {
    color: var(--active-green) !important;
    font-weight: bold;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.card-info {
    flex: 1;
}

.password-display {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--accent);
}

/* Tabs */
.controls-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.tabs {
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 12px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.count-bubble {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.search-box {
    position: relative;
}

.search-box input {
    padding-right: 40px;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Actions */
.card-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: white;
    color: black;
}

.icon-btn.delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 20px;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content.small-modal {
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal, .close-browser-modal {
    float: left;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.close-modal:hover, .close-browser-modal:hover {
    color: #ef4444;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-left: 40px;
}

.toggle-pass {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.toggle-pass:hover {
    color: var(--primary);
}

/* Cursor Orbit */
#cursor-orbit {
    position: fixed;
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
}

.orbit-core {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--primary-glow);
}

.orbit-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    animation: orbit 3s linear infinite;
}

.orbit-circle:nth-child(3) {
    animation-delay: -1.5s;
    border-color: rgba(34, 211, 238, 0.3);
}

@keyframes orbit {
    from { transform: rotate(0deg) scale(1); opacity: 1; }
    to { transform: rotate(360deg) scale(1.5); opacity: 0; }
}

/* Responsive */
@media (max-width: 600px) {
    .email-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .card-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .auth-content {
        padding: 25px;
    }
}
