/* ═══════════════════════════════════════════════════════════════════════════
 * URL Shortener - Main Styles
 * ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
    --primary: #972520;
    --primary-dark: #6b1a16;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #F7F7F7;
    --card: #ffffff;
    --text: #3a3a3a;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #2a2a2a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text);
}

.container {
    width: 100%;
    max-width: 600px;
}

.card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    margin-bottom: 20px;
}

.header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.logo svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 2px 4px rgba(151, 37, 32, 0.2));
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
}

.label-optional {
    font-weight: 400;
    color: var(--text-light);
    font-size: 12px;
}

input[type="text"],
input[type="url"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(151, 37, 32, 0.1);
}

input.error {
    border-color: var(--error);
}

input.success {
    border-color: var(--success);
}

.input-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    display: block;
}

.error-message {
    color: var(--error);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.error-message.show {
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn.loading .spinner {
    display: block;
}

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

.result {
    display: none;
    padding: 20px;
    border-radius: 8px;
    margin-top: 24px;
}

.result.success {
    background: #d1fae5;
    border: 2px solid var(--success);
    display: block;
}

.result.error {
    background: #fee2e2;
    border: 2px solid var(--error);
    display: block;
}

.result-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 16px;
}

.result.success .result-title {
    color: #065f46;
}

.result.error .result-title {
    color: #991b1b;
}

.short-url-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.short-url-link {
    flex: 1;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
}

.btn-copy {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--primary-dark);
}

.btn-copy.copied {
    background: var(--success);
}

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

.stat-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
}

.stat-label {
    color: var(--text-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-weight: 600;
    color: var(--text);
}

.footer {
    text-align: center;
    color: white;
    font-size: 14px;
    margin-top: 20px;
}

.footer a {
    color: white;
    text-decoration: underline;
}

.settings-toggle {
    text-align: center;
    margin-top: 16px;
    display: none; /* Hidden - replaced by modal */
}

.settings-link {
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed var(--text-light);
    transition: color 0.2s;
    display: none; /* Hidden - replaced by modal */
}

.settings-link:hover {
    color: var(--text);
}

.settings-panel {
    display: none; /* Hidden - replaced by modal */
}

.settings-panel.show {
    display: none; /* Hidden - replaced by modal */
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Modal Styles
 * ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2);
    max-width: 500px;
    width: 100%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-description {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn {
    width: auto;
    min-width: 120px;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

@media (max-width: 640px) {
    .modal {
        margin: 0;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Legacy Settings Panel (now unused, kept for backwards compatibility)
 * ═══════════════════════════════════════════════════════════════════════════ */

    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.settings-panel.show {
    display: block;
}

@media (max-width: 640px) {
    .card {
        padding: 24px;
    }

    h1 {
        font-size: 24px;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
 * Cookie Notice Banner
 * ═══════════════════════════════════════════════════════════════════════════ */

.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(42, 42, 42, 0.98);
    backdrop-filter: blur(10px);
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    animation: slideUp 0.4s ease-out;
}

.cookie-notice.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-notice-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-notice-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.cookie-notice-content strong {
    font-size: 16px;
}

.cookie-notice-content a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.cookie-notice-content a:hover {
    color: #fff;
    opacity: 0.8;
}

.btn-accept-cookies {
    align-self: flex-start;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-accept-cookies:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .cookie-notice {
        padding: 16px;
    }

    .cookie-notice-content {
        gap: 10px;
    }

    .btn-accept-cookies {
        align-self: stretch;
        width: 100%;
    }
}


