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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 40px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    text-align: left;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.user-name {
    color: white;
    font-weight: 500;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-profile:hover .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.menu-item:hover {
    background-color: #f7fafc;
}

.login-btn {
    background: white;
    color: #667eea;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.3);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.cipher-selection {
    margin-bottom: 30px;
}

.cipher-selection h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #4a5568;
    font-size: 1.5rem;
}

.cipher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.cipher-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.cipher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.cipher-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.cipher-btn i {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.practice-area {
    background: #f7fafc;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.cipher-info {
    text-align: center;
    margin-bottom: 25px;
}

.cipher-info h3 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.cipher-info p {
    color: #718096;
    font-size: 0.95rem;
}

.cipher-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
    color: #4a5568;
}

.control-group select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.generate-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.code-display {
    margin-bottom: 25px;
}

.code-display h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.encoded-text {
    background: #2d3748;
    color: #48bb78;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #4a5568;
}

.decode-section {
    margin-bottom: 25px;
}

.decode-section h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 1;
    min-width: 250px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.check-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.result {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

.result.correct {
    background: #c6f6d5;
    color: #22543d;
    border: 2px solid #48bb78;
}

.result.incorrect {
    background: #fed7d7;
    color: #742a2a;
    border: 2px solid #f56565;
}

.hint-section {
    text-align: center;
}

.hint-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.3);
}

.hint-text {
    background: #fffaf0;
    border: 2px solid #ed8936;
    border-radius: 8px;
    padding: 15px;
    color: #744210;
    font-style: italic;
    display: none;
}

.hint-text.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Cipher information styling - blue theme */
.hint-text.cipher-info {
    background: #e3f2fd;
    border: 2px solid #1976d2;
    color: #0d47a1;
}

/* Frequent letters styling - green theme */
.hint-text.freq-letters {
    background: #e8f5e8;
    border: 2px solid #388e3c;
    color: #1b5e20;
}

/* Keep original orange theme for hints */
.hint-text.hint {
    background: #fffaf0;
    border: 2px solid #ed8936;
    color: #744210;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.stat-card i {
    font-size: 1.5rem;
    color: #667eea;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 2px solid #e2e8f0;
}

.dashboard-card h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.large-profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #667eea;
}

.profile-details h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.profile-details p {
    color: #718096;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.preference-item {
    margin-bottom: 15px;
}

.preference-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5568;
    font-weight: 500;
}

.preference-item select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    margin-top: 5px;
    width: 100%;
}

.save-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.rank {
    font-weight: 700;
    color: #667eea;
    min-width: 30px;
}

.name {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.score {
    color: #48bb78;
    font-weight: 600;
}

.accuracy {
    color: #718096;
    font-size: 0.9rem;
}

.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.action-btn.hint {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.action-btn.info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.action-btn-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.loading {
    text-align: center;
    color: #718096;
    font-style: italic;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .cipher-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .cipher-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group input {
        min-width: auto;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-info {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
} 