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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1f1f1f 100%);
    color: #e4e8f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    animation: slideIn 0.6s ease;
    justify-content: center;
}

.logo-section {
    flex-shrink: 0;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 50%, #8b7500 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.3);
}

.logo svg {
    width: 40px;
    height: 40px;
}

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

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #d4af37;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.header-text p {
    font-size: 0.95rem;
    color: #a0a0a0;
    letter-spacing: 0.5px;
    font-style: italic;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background: rgba(45, 45, 45, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 28px;
    height: 28px;
    stroke: #d4af37;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #d4af37;
}

.form-group {
    margin-bottom: 1.6rem;
}

.form-label {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #b0b0b0;
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea,
input[type="password"],
input[type="text"] {
    width: 100%;
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #e4e8f0;
    padding: 0.95rem 1.1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    transition: all 0.3s ease;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

textarea {
    resize: vertical;
    min-height: 140px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.password-wrapper.error {
    border-radius: 10px;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.3);
}

.password-wrapper.error input {
    border-color: #ff4444;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}

.password-wrapper input {
    padding-right: 3.5rem;
}

.toggle-pwd {
    position: absolute;
    right: 1.1rem;
    background: none;
    border: none;
    color: #d4af37;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toggle-pwd:hover {
    color: #f5d061;
    transform: scale(1.1);
}

.toggle-pwd svg {
    width: 18px;
    height: 18px;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn {
    flex: 1;
    min-width: 140px;
    padding: 1rem 1.5rem;
    border: 1px solid;
    background: transparent;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-encrypt {
    border-color: #d4af37;
    color: #d4af37;
}

.btn-encrypt:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #f5d061;
    color: #f5d061;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.btn-decrypt {
    border-color: #c0c0c0;
    color: #c0c0c0;
}

.btn-decrypt:hover {
    background: rgba(192, 192, 192, 0.15);
    border-color: #d8d8d8;
    color: #d8d8d8;
    box-shadow: 0 8px 20px rgba(192, 192, 192, 0.3);
}

.btn-copy {
    border-color: #d4af37;
    color: #d4af37;
    flex: 1;
}

.btn-copy:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #f5d061;
    color: #f5d061;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.btn-copy.copied {
    border-color: #00c853;
    color: #00c853;
    background: rgba(0, 200, 83, 0.1);
}

.btn-reset {
    border-color: #ff4444;
    color: #ff4444;
    flex: 1;
}

.btn-reset:hover {
    background: rgba(255, 68, 68, 0.15);
    border-color: #ff6666;
    color: #ff6666;
    box-shadow: 0 8px 20px rgba(255, 68, 68, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

#resultBox {
    width: 100%;
    min-height: 200px;
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 1.4rem;
    border-radius: 10px;
    font-size: 1.125rem;
    line-height: 1.7;
    word-break: break-all;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    overflow-y: auto;
    max-height: 320px;
    transition: all 0.3s ease;
    flex: 1;
}

#resultBox.success {
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.3);
}

#resultBox.error {
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.3);
}

#resultBox:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

#resultBox:empty::before {
    content: 'Output appears here';
    color: #555d7a;
    opacity: 0.7;
}

#resultBox:empty {
    border-color: rgba(212, 175, 55, 0.3);
}

.output-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(45, 45, 45, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    animation: fadeIn 0.6s ease 0.2s both;
    margin-top: 2.5rem;
}

.status-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    width: 40px;
    height: 40px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon svg {
    width: 22px;
    height: 22px;
    stroke: #d4af37;
}

.status-content {
    flex: 1;
}

.status-label {
    font-size: 0.75rem;
    color: #888fa3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.status-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e4e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.online {
    background: #d4af37;
}

.status-dot.offline {
    background: #ff4444;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f5d061;
}

/* Key display styling */
.demo-key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 6px;
    border-left: 3px solid #d4af37;
}

.demo-key-display .icon {
    color: #888fa3;
    font-size: 0.8rem;
}

.demo-key-display .label {
    color: #888fa3;
    font-size: 0.8rem;
}

.demo-key-display .key {
    background: rgba(30, 30, 30, 0.7);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    color: #d4af37;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        text-align: center;
    }

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

    .header-text h1 {
        font-size: 2rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .footer {
        grid-template-columns: 1fr;
    }

    .btn-reset {
        align-self: stretch;
    }

    .output-actions {
        flex-direction: column;
    }

    .demo-key-display {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Additional Gold Accents */
.gold-text {
    color: #d4af37;
}

.gold-border {
    border-color: #d4af37;
}

.gold-bg {
    background: rgba(212, 175, 55, 0.1);
}

.gold-gradient {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 50%, #8b7500 100%);
}

/* Selection Color */
::selection {
    background: #d4af37;
    color: #1a1a1a;
}

/* Custom focus outlines */
input:focus,
textarea:focus,
button:focus {
    outline: 2px solid rgba(212, 175, 55, 0.3);
    outline-offset: 2px;
}

/* Hover effect for cards */
.card {
    transition: all 0.4s ease;
}

.card:hover .card-title {
    color: #f5d061;
    transition: color 0.3s ease;
}

.card:hover .card-icon {
    background: rgba(212, 175, 55, 0.3);
    transition: background 0.3s ease;
}