/* Reset & Base Styles - Flat Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Flat Color Palette */
    --green-light: #A8D5BA;
    --beige-bg: #F5F1E8;
    --gray-light: #E8E8E8;
    --gray-medium: #D0D0D0;
    --yellow-cream: #FFF8E1;
    --blue-flat: #4A90E2;
    --text-dark: #2C2C2C;
    --text-medium: #666666;
    --white: #FFFFFF;
    --border-thin: 1px solid #D0D0D0;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--green-light);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    padding: 0;
    direction: rtl;
    margin: 0;
}

.container {
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.content-wrapper {
    width: 100%;
    max-width: 600px;
    background: var(--beige-bg);
    border: 8px solid var(--green-light);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

/* Header Styles - Flat */
.header {
    background: var(--beige-bg);
    padding: 30px 24px 20px;
    text-align: center;
    border-bottom: var(--border-thin);
    position: relative;
}

.logo-container {
    position: relative;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    letter-spacing: 0.5px;
}

.brand-name {
    letter-spacing: 1px;
    color: var(--text-dark);
}

.brand-separator {
    opacity: 0.4;
    font-weight: 300;
    color: var(--text-medium);
}

.brand-subtitle {
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-dark);
}

.brand-tagline {
    color: var(--text-medium);
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 8px;
}

/* Admin Button */
.admin-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    background: var(--blue-flat);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-btn:hover {
    background: #3A7BC8;
}

.admin-btn:active {
    background: #2E6BA8;
}

/* Main Content - Flat */
.main-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--beige-bg);
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Form Inputs - Flat */
.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: var(--border-thin);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--gray-light);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-textarea:focus {
    background: var(--white);
    border-color: var(--gray-medium);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-medium);
    opacity: 0.7;
}

.form-input-title {
    min-height: 48px;
}

.form-textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

.char-counter {
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-medium);
    margin-top: 4px;
    padding-right: 4px;
}

.char-counter span {
    font-weight: 500;
    color: var(--text-dark);
}

/* Bottom Bar - Flat */
.bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--yellow-cream);
    border-top: var(--border-thin);
    margin-top: auto;
    gap: 16px;
}

.bottom-text {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
    text-align: right;
    line-height: 1.5;
}

/* Submit Button - Flat */
.submit-btn {
    width: 48px;
    height: 48px;
    background: var(--blue-flat);
    color: var(--white);
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.submit-btn:hover {
    background: #3A7BC8;
}

.submit-btn:active {
    background: #2E6BA8;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    width: 20px;
    height: 20px;
    stroke: var(--white);
    transform: scaleX(-1);
}

/* Success Message - Flat */
.success-message {
    text-align: center;
    padding: 40px 24px;
    background: var(--beige-bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.success-message.hidden {
    display: none;
}

.success-message h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.success-message p {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin: 0;
}

.reset-btn {
    padding: 12px 24px;
    background: var(--blue-flat);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 8px;
}

.reset-btn:hover {
    background: #3A7BC8;
}

.reset-btn:active {
    background: #2E6BA8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .content-wrapper {
        border-width: 6px;
        min-height: calc(100vh - 24px);
    }

    .header {
        padding: 24px 20px 16px;
    }

    .brand-title {
        font-size: 1.6rem;
    }

    .brand-subtitle {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 20px;
    }

    .form-input,
    .form-textarea {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .form-textarea {
        min-height: 180px;
    }

    .bottom-bar {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .bottom-text {
        text-align: center;
        font-size: 0.8rem;
    }

    .submit-btn {
        width: 100%;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .content-wrapper {
        border-width: 4px;
    }

    .header {
        padding: 20px 16px 14px;
    }

    .brand-title {
        font-size: 1.4rem;
        gap: 6px;
    }

    .brand-subtitle {
        font-size: 1.1rem;
    }

    .brand-tagline {
        font-size: 0.85rem;
    }

    .main-content {
        padding: 16px;
    }

    .form-input,
    .form-textarea {
        padding: 12px;
        border-radius: 4px;
    }

    .bottom-bar {
        padding: 12px;
    }
}

/* Loading State - Flat */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Flat Design - No shadows, gradients, or glows */
.form-input,
.form-textarea,
.submit-btn,
.reset-btn,
.content-wrapper,
.header,
.bottom-bar {
    box-shadow: none;
    text-shadow: none;
    filter: none;
}

/* Admin Login Modal */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.admin-modal.hidden {
    display: none;
}

.admin-modal-content {
    background: var(--beige-bg);
    border: 8px solid var(--green-light);
    padding: 32px;
    max-width: 400px;
    width: 100%;
}

.admin-modal-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 24px;
    text-align: center;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-input-group {
    display: flex;
    flex-direction: column;
}

.admin-code-input {
    width: 100%;
    padding: 14px 16px;
    border: var(--border-thin);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--gray-light);
    transition: background-color 0.2s ease;
    outline: none;
    text-align: center;
    letter-spacing: 4px;
    font-weight: 500;
}

.admin-code-input:focus {
    background: var(--white);
    border-color: var(--gray-medium);
}

.admin-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.admin-cancel-btn,
.admin-submit-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-cancel-btn {
    background: var(--gray-light);
    color: var(--text-dark);
}

.admin-cancel-btn:hover {
    background: var(--gray-medium);
}

.admin-submit-btn {
    background: var(--blue-flat);
    color: var(--white);
}

.admin-submit-btn:hover {
    background: #3A7BC8;
}

.admin-error {
    background: #FEE2E2;
    color: #DC2626;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 8px;
}

.admin-error.hidden {
    display: none;
}

/* Admin Panel */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--beige-bg);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.admin-panel.hidden {
    display: none;
}

.admin-panel-header {
    max-width: 1200px;
    margin: 0 auto 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: var(--border-thin);
}

.admin-panel-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

.admin-logout-btn {
    padding: 10px 20px;
    background: var(--gray-light);
    color: var(--text-dark);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-logout-btn:hover {
    background: var(--gray-medium);
}

.admin-stats {
    max-width: 1200px;
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--white);
    border: var(--border-thin);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--blue-flat);
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.admin-feedbacks-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: var(--border-thin);
    padding-bottom: 0;
}

.admin-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.admin-tab:hover {
    color: var(--text-dark);
    background: var(--gray-light);
}

.admin-tab.active {
    color: var(--blue-flat);
    border-bottom-color: var(--blue-flat);
    font-weight: 600;
}

.admin-feedbacks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: var(--border-thin);
}

.admin-feedbacks-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
}

.admin-refresh-btn {
    padding: 8px 16px;
    background: var(--blue-flat);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-refresh-btn:hover {
    background: #3A7BC8;
}

.feedbacks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.feedback-card {
    background: var(--white);
    border: var(--border-thin);
    border-radius: 6px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: var(--border-thin);
}

.feedback-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.feedback-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.featured-badge {
    background: var(--yellow-cream);
    color: var(--text-dark);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.feedback-date {
    font-size: 0.85rem;
    color: var(--text-medium);
    white-space: nowrap;
}

.feedback-text {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
}

.feedback-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: var(--border-thin);
    justify-content: flex-end;
}

.feedback-star-btn,
.feedback-delete-btn {
    padding: 8px 12px;
    background: var(--gray-light);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
}

.feedback-star-btn svg,
.feedback-delete-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.feedback-star-btn {
    color: var(--text-medium);
}

.feedback-star-btn.starred {
    color: #F59E0B;
}

.feedback-delete-btn {
    color: var(--text-medium);
}

.feedback-delete-btn:hover {
    color: #DC2626;
}

.feedback-star-btn:hover {
    color: #F59E0B;
}

.feedback-star-btn:hover {
    background: var(--yellow-cream);
}

.feedback-star-btn.starred {
    background: var(--yellow-cream);
}

.feedback-delete-btn:hover {
    background: #FEE2E2;
}

.featured-badge svg {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    width: 14px;
    height: 14px;
}

.feedback-card.featured {
    border: 2px solid var(--yellow-cream);
    background: #FFFEF9;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
    font-size: 1rem;
}

/* Responsive Admin Panel */
@media (max-width: 768px) {
    .admin-btn {
        position: static;
        margin-top: 12px;
        width: 100%;
    }

    .admin-modal-content {
        padding: 24px;
    }

    .admin-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-logout-btn {
        width: 100%;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        flex-direction: column;
        gap: 0;
    }

    .admin-tab {
        width: 100%;
        text-align: right;
        border-bottom: var(--border-thin);
        border-left: 3px solid transparent;
        border-right: none;
    }

    .admin-tab.active {
        border-left-color: var(--blue-flat);
        border-bottom-color: var(--border-thin);
    }

    .admin-feedbacks-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-refresh-btn {
        width: 100%;
    }

    .feedback-header {
        flex-direction: column;
        gap: 8px;
    }

    .feedback-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .feedback-actions {
        justify-content: flex-start;
    }
}
