* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

.header-content {
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #667eea;
}

.logo h1 {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.back-btn {
    position: absolute;
    top: 0;
    left: 0;
    padding: 12px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    margin: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Password Display Section */
.password-display-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.password-output-container {
    max-width: 600px;
    margin: 0 auto;
}

.password-field {
    position: relative;
    margin-bottom: 25px;
}

.password-field input {
    width: 100%;
    padding: 20px 120px 20px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    background: white;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.password-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-field input.password-hidden {
    letter-spacing: 0;
    font-size: 2rem;
    -webkit-text-security: disc;
}

.password-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 5px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.action-btn.active {
    background: #667eea;
    color: white;
}

/* Strength Meter */
.strength-meter {
    margin-top: 20px;
}

.strength-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.5s ease;
    border-radius: 4px;
}

.strength-fill.weak {
    width: 25%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
}

.strength-fill.fair {
    width: 50%;
    background: linear-gradient(90deg, #ffa726, #ffcc02);
}

.strength-fill.good {
    width: 75%;
    background: linear-gradient(90deg, #42a5f5, #478ed1);
}

.strength-fill.strong {
    width: 100%;
    background: linear-gradient(90deg, #66bb6a, #43a047);
}

/* Generator Options */
.generator-options {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.options-container {
    display: grid;
    gap: 40px;
}

.option-section h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-section h3 i {
    color: #667eea;
}

/* Length Control */
.length-control {
    display: flex;
    align-items: center;
    gap: 20px;
}

.slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e1e5e9;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.length-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

#length-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.length-label {
    font-size: 0.9rem;
    color: #666;
}

/* Character Options */
.character-options,
.advanced-options {
    display: grid;
    gap: 15px;
}

.option-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
}

.option-group:hover {
    background: #f1f3f4;
    transform: translateY(-1px);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    position: relative;
}

.checkbox-container input {
    opacity: 0;
    position: absolute;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked + .checkmark::after {
    display: block;
}

.option-text {
    font-weight: 500;
    flex: 1;
}

.option-example {
    font-size: 0.9rem;
    color: #666;
    font-family: 'Courier New', monospace;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Preset Buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.preset-btn {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.preset-btn i {
    font-size: 1.5rem;
    color: #667eea;
}

.preset-btn span {
    font-weight: 600;
    color: #333;
}

.preset-btn small {
    color: #666;
    font-size: 0.8rem;
}

/* Generate Button */
.generate-section {
    text-align: center;
}

.generate-btn {
    padding: 20px 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.generate-btn:active {
    transform: translateY(-1px);
}

/* History Section */
.history-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.history-header h3 {
    font-size: 1.4rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-header h3 i {
    color: #667eea;
}

.clear-history-btn {
    padding: 10px 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-history-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.history-empty i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #ccc;
}

.history-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #f1f3f4;
    transform: translateY(-1px);
}

.history-password {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    flex: 1;
    margin-right: 15px;
    word-break: break-all;
}

.history-actions {
    display: flex;
    gap: 5px;
}

.history-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-btn:hover {
    background: #667eea;
    color: white;
}

/* Security Tips */
.security-tips {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tips-header h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tips-header h3 i {
    color: #ffa726;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tip-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tip-card i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.tip-card h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

.tip-card p {
    color: #666;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 20px;
    margin: 0 20px 20px;
    border-radius: 15px;
    color: #666;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.security-notice {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #4caf50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 0.3s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake-animation {
    animation: shake 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }

    .header,
    .main-content,
    .footer {
        margin: 10px;
    }

    .header {
        padding: 20px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .logo i {
        font-size: 2rem;
    }

    .back-btn {
        position: relative;
        margin-bottom: 20px;
        align-self: flex-start;
    }

    .password-display-section,
    .generator-options,
    .history-section,
    .security-tips {
        padding: 20px;
    }

    .password-field input {
        padding: 15px 100px 15px 15px;
        font-size: 1rem;
    }

    .length-control {
        flex-direction: column;
        gap: 15px;
    }

    .preset-buttons {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .history-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .history-item {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .character-options,
    .advanced-options {
        gap: 10px;
    }

    .option-group {
        padding: 12px;
    }

    .checkbox-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .password-actions {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 15px;
        justify-content: center;
    }

    .password-field input {
        padding: 15px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}