/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

body.dark {
    background: #1a1a1a;
    color: #e9ecef;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    transition: background 0.3s;
    position: relative;
}

body.dark .container {
    background: #2d2d2d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

body.dark header {
    border-bottom-color: #495057;
}

h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    color: #0078d4;
    font-weight: 600;
}

body.dark h1 {
    color: #4dabf7;
}

h1::before {
    content: '🔒 ';
}

h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #495057;
    font-weight: 500;
}

body.dark h2 {
    color: #adb5bd;
}

.section {
    margin-bottom: 50px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: box-shadow 0.3s;
}

.section:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.dark .section {
    background: #343a40;
    border-color: #495057;
}

body.dark .section:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

body.dark label {
    color: #adb5bd;
}

textarea, input[type="password"] {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #ffffff;
    color: #212529;
}

textarea:focus, input[type="password"]:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

body.dark textarea, body.dark input[type="password"] {
    background: #495057;
    color: #e9ecef;
    border-color: #6c757d;
}

body.dark textarea:focus, body.dark input[type="password"]:focus {
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

.password-container {
    position: relative;
}

.toggle-btn {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 5px;
    margin-bottom: 10px;
    transition: background 0.3s;
    display: block;
    width: auto;
}

.toggle-btn:hover {
    background: #5a6268;
}

body.dark .toggle-btn {
    background: #adb5bd;
    color: #212529;
}

body.dark .toggle-btn:hover {
    background: #6c757d;
}

.strength-meter {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: background 0.3s;
}

body.dark .strength-meter {
    background: #495057;
}

.strength-meter div {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

button {
    background: #0078d4;
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.3s, transform 0.1s, box-shadow 0.3s;
    margin-right: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: #106ebe;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.copy-btn {
    background: #28a745;
}

.copy-btn:hover {
    background: #218838;
}

.output {
    margin-top: 25px;
}

.output.hidden {
    display: none;
}

.output textarea {
    margin-bottom: 15px;
    resize: vertical;
}

footer {
    margin-top: 50px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    font-size: 0.95em;
}

body.dark footer {
    background: #343a40;
    border-color: #495057;
}

footer h3 {
    margin-bottom: 15px;
    color: #dc3545;
    font-weight: 600;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

footer li::before {
    content: '⚠️';
    position: absolute;
    left: 0;
}

footer a {
    color: #0078d4;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

body.dark footer a {
    color: #4dabf7;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    h1 {
        font-size: 2.2em;
    }
    h2 {
        font-size: 1.5em;
    }
    .section {
        padding: 20px;
    }
    button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
    }
    #darkModeToggle {
        position: static;
        margin-top: 15px;
        display: block;
        margin-left: auto;
        margin-right: auto;
        width: auto;
    }
}

/* Dark mode toggle */
#darkModeToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    color: #212529;
    border: 2px solid #dee2e6;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    z-index: 1000;
}

body.dark #darkModeToggle {
    background: #343a40;
    color: #e9ecef;
    border-color: #495057;
}

/* Trust indicators */
.trust-indicator {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 10px;
    vertical-align: middle;
}

.trust-indicator::before {
    content: '✓ ';
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Custom Alert Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    text-align: center;
    animation: modalAppear 0.3s ease-out;
}

body.dark .modal-content {
    background: #2d2d2d;
    color: #e9ecef;
}

@keyframes modalAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#alertMessage {
    margin-bottom: 20px;
    font-size: 1.1em;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#alertOkBtn, #alertCancelBtn {
    background: #0078d4;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.3s;
}

#alertOkBtn:hover, #alertCancelBtn:hover {
    background: #106ebe;
}

#alertCancelBtn {
    background: #6c757d;
}

#alertCancelBtn:hover {
    background: #5a6268;
}

/* Dark mode toggle */
#darkModeToggle {
    position: static;
    margin-top: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: auto;
    background: #ffffff;
    color: #212529;
    border: 2px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    white-space: nowrap;
}

body.dark #darkModeToggle {
    background: #343a40;
    color: #e9ecef;
    border-color: #495057;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    h1 {
        font-size: 2.2em;
    }
    h2 {
        font-size: 1.5em;
    }
    .section {
        padding: 20px;
    }
    button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
    }
    #darkModeToggle {
        top: 5px;
        right: 5px;
        padding: 6px 12px;
        font-size: 0.8em;
    }
}
