/* ================================
   Rewind Support Page Styles
   iOS Design System
   ================================ */

/* CSS Variables */
:root {
    --ios-blue: #007AFF;
    --ios-blue-dark: #0051D5;
    --ios-gray: #8E8E93;
    --ios-light-gray: #F2F2F7;
    --ios-separator: #E5E5EA;
    --ios-white: #FFFFFF;
    --ios-black: #000000;
    --ios-green: #34C759;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F8FC;
    --bg-tertiary: #F2F2F7;
    --bg-elevated: #FFFFFF;

    --label-primary: #000000;
    --label-secondary: #6E6E73;
    --label-tertiary: #A1A1A6;

    --fill-primary: #E8E8ED;
    --fill-secondary: #EDEDF2;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    --ease-ios: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --bg-elevated: #1C1C1E;

    --label-primary: #FFFFFF;
    --label-secondary: #ABABAB;
    --label-tertiary: #6E6E73;

    --fill-primary: #2C2C2E;
    --fill-secondary: #38383A;

    --ios-separator: #38383A;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #000000;
        --bg-secondary: #1C1C1E;
        --bg-tertiary: #2C2C2E;
        --bg-elevated: #1C1C1E;

        --label-primary: #FFFFFF;
        --label-secondary: #ABABAB;
        --label-tertiary: #6E6E73;

        --fill-primary: #2C2C2E;
        --fill-secondary: #38383A;

        --ios-separator: #38383A;
    }
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--label-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Settings Bar */
.settings-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 12px;
}

.toggle-button {
    width: 44px;
    height: 44px;
    background: var(--bg-elevated);
    border: 1px solid var(--ios-separator);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-ios);
    box-shadow: var(--shadow-sm);
}

.toggle-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--label-primary);
}

.theme-icon {
    width: 20px;
    height: 20px;
    color: var(--label-primary);
}

.theme-icon.moon {
    display: none;
}

[data-theme="dark"] .theme-icon.sun {
    display: none;
}

[data-theme="dark"] .theme-icon.moon {
    display: block;
}

/* Header */
.support-header {
    padding: 24px;
    display: flex;
    justify-content: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--label-primary);
}

/* Support Hero */
.support-hero {
    padding: 60px 24px;
    text-align: center;
    background: var(--bg-secondary);
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.hero-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--ios-blue);
}

.support-hero h1 {
    font-size: clamp(28px, 6vw, 40px);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.support-hero p {
    font-size: 17px;
    color: var(--label-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Quick Links */
.quick-links-section {
    padding: 40px 24px;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--ios-separator);
    border-radius: 16px;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-ios);
    box-shadow: var(--shadow-sm);
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--ios-blue);
}

.quick-link-card svg {
    width: 32px;
    height: 32px;
    stroke: var(--ios-blue);
}

.quick-link-card span {
    font-size: 15px;
    font-weight: 600;
    color: var(--label-primary);
}

/* Section Common */
.section-container {
    max-width: 700px;
    margin: 0 auto;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--label-primary);
}

.section-subtitle {
    font-size: 16px;
    color: var(--label-secondary);
    margin-bottom: 32px;
}

/* FAQ Section */
.faq-section {
    padding: 60px 24px;
    background: var(--bg-secondary);
}

.faq-section .section-title {
    text-align: center;
    margin-bottom: 32px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-elevated);
    border: 1px solid var(--ios-separator);
    border-radius: 14px;
    overflow: hidden;
    transition: all var(--duration-fast);
}

.faq-item.expanded {
    box-shadow: var(--shadow-md);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    cursor: pointer;
    transition: background var(--duration-fast);
}

.faq-question:hover {
    background: var(--fill-secondary);
}

.faq-question h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--label-primary);
    margin: 0;
    flex: 1;
    padding-right: 16px;
}

.faq-icon {
    width: 24px;
    height: 24px;
    stroke: var(--label-tertiary);
    transition: transform var(--duration-fast);
    flex-shrink: 0;
}

.faq-item.expanded .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 20px 18px;
}

.faq-item.expanded .faq-answer {
    display: block;
    animation: fade-in 0.2s ease-out;
}

.faq-answer p {
    font-size: 15px;
    color: var(--label-secondary);
    line-height: 1.6;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Section */
.contact-section {
    padding: 60px 24px;
    flex: 1;
}

.contact-section .section-title,
.contact-section .section-subtitle {
    text-align: center;
}

.contact-card {
    background: var(--bg-elevated);
    border: 1px solid var(--ios-separator);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

/* Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 500px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--label-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    background: var(--fill-primary);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--label-primary);
    outline: none;
    transition: all var(--duration-fast) var(--ease-ios);
    -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--ios-gray);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--ios-blue);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    background: var(--ios-blue);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-ios);
    position: relative;
    align-self: flex-start;
}

.submit-button:hover {
    background: var(--ios-blue-dark);
    transform: scale(1.02);
}

.submit-button:active {
    transform: scale(0.98);
}

.submit-button.loading {
    pointer-events: none;
}

.submit-button.loading .button-text {
    opacity: 0;
}

.submit-button.loading .button-loader {
    opacity: 1;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 40px 20px;
    animation: scale-in 0.4s var(--ease-ios);
}

.success-message.hidden {
    display: none;
}

.success-icon {
    width: 70px;
    height: 70px;
    background: var(--ios-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg {
    width: 36px;
    height: 36px;
    stroke: white;
}

.success-message h3 {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--label-primary);
}

.success-message p {
    font-size: 15px;
    color: var(--label-secondary);
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Alt Contact */
.alt-contact {
    text-align: center;
    margin-top: 32px;
}

.alt-contact p {
    font-size: 14px;
    color: var(--label-tertiary);
    margin-bottom: 8px;
}

.email-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--ios-blue);
    text-decoration: none;
}

.email-link:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    padding: 40px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--ios-separator);
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

@media (min-width: 600px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.footer-logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--label-primary);
}

.footer-copyright {
    font-size: 13px;
    color: var(--label-tertiary);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    font-size: 13px;
    color: var(--label-secondary);
    text-decoration: none;
    transition: color var(--duration-fast);
}

.footer-link:hover {
    color: var(--ios-blue);
}

/* Responsive */
@media (max-width: 500px) {
    .contact-card {
        padding: 24px 20px;
    }

    .submit-button {
        width: 100%;
    }
}