/* Feedny Styles - Black & White Theme */

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

:root {
    --color-primary: #000000;
    --color-secondary: #ffffff;
    --color-background: #ffffff;
    --color-text: #000000;
    --color-border: #e5e7eb;
    --color-border-dark: #d1d5db;
    --color-success: #059669;
    --color-error: #dc2626;
    --color-info: #2563eb;
    --color-warning: #d97706;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-border-dark);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
    /* Minimum readable size */
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    /* Prevent iOS zoom */
    border: 2px solid var(--color-border-dark);
    border-radius: 12px;
    font-family: inherit;
    background-color: var(--color-background);
    color: var(--color-text);
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--color-primary);
}

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

/* Character counter */
.char-count {
    text-align: right;
    font-size: 14px;
    color: #6b7280;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--color-primary);
    border-radius: 20px;
    /* Rounded 20px as specified */
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    /* Touch target minimum */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: #1f2937;
    transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-border);
}

.btn-danger {
    background-color: var(--color-error);
    color: white;
    border-color: var(--color-error);
}

.btn-danger:hover:not(:disabled) {
    background-color: #991b1b;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Feedback Form */
.feedback-form {
    max-width: 600px;
    margin: 0 auto;
}

.question-container {
    background-color: var(--color-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    border: 2px solid var(--color-border-dark);
}

.question-container h2 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text);
}

/* Messages */
.success-message,
.info-message,
.error-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon,
.info-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-icon {
    color: var(--color-success);
}

.info-icon {
    color: var(--color-info);
}

.error-icon {
    color: var(--color-error);
}

.success-message h2,
.info-message h2 {
    font-size: 1.75rem;
    margin-bottom: 10px;
}

.info {
    color: #6b7280;
    margin-top: 10px;
}

/* Login Page */
.login-container {
    max-width: 400px;
}

.login-form {
    margin-top: 30px;
}

.error-message {
    background-color: #fef2f2;
    border: 2px solid var(--color-error);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
}

.error-message p {
    color: var(--color-error);
    margin: 0;
}

.auth-link {
    text-align: center;
    margin-top: 15px;
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--color-background);
    border: 2px solid var(--color-border-dark);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Sections */
.feedbacks-section,
.analysis-section,
.results-section {
    margin-bottom: 40px;
}

.feedbacks-section h2,
.analysis-section h2,
.results-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border-dark);
}

/* Table */
.table-container {
    overflow-x: auto;
    border: 2px solid var(--color-border-dark);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

thead {
    background-color: var(--color-border);
}

th {
    padding: 14px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--color-border-dark);
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--color-border);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: var(--color-border);
}

.checkbox-column {
    width: 50px;
    text-align: center;
}

.feedback-content {
    max-width: 400px;
    word-wrap: break-word;
}

.feedback-date {
    white-space: nowrap;
    font-size: 0.875rem;
    color: #6b7280;
}

.feedback-status {
    text-align: center;
    width: 60px;
}

.status-included {
    color: var(--color-success);
    font-weight: 700;
    font-size: 1.25rem;
}

.status-excluded {
    color: #9ca3af;
    font-weight: 700;
    font-size: 1.25rem;
}

.no-data {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}

/* Wordcloud */
.wordcloud-container {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--color-background);
    border: 2px solid var(--color-border-dark);
    border-radius: 12px;
}

#wordcloud-image {
    max-width: 100%;
    height: auto;
}

/* Summary */
.summary-container {
    background-color: var(--color-background);
    border: 2px solid var(--color-border-dark);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-container h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

#summary-text {
    line-height: 1.8;
    color: #1f2937;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    border-top: 2px solid var(--color-border-dark);
    margin-top: auto;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
    }

    table {
        font-size: 0.875rem;
    }

    th,
    td {
        padding: 10px 8px;
    }

    .feedback-content {
        max-width: 200px;
    }

    .wordcloud-container {
        padding: 10px;
    }

    .summary-container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

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

    .table-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    th,
    td {
        padding: 8px 6px;
    }

    .feedback-content {
        max-width: 150px;
        font-size: 0.8125rem;
    }

    .btn {
        padding: 12px 20px;
    }
}

/* Emoji Picker */
.emoji-section {
    margin-top: 20px;
    margin-bottom: 20px;
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px;
    background-color: var(--color-border);
    border-radius: 12px;
}

.emoji-btn {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    border: 2px solid transparent;
    border-radius: 50%;
    background-color: var(--color-background);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    transform: scale(1.15);
    border-color: var(--color-border-dark);
}

.emoji-btn.selected {
    border-color: var(--color-primary);
    background-color: var(--color-border);
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Emotion display in table */
.feedback-emotion {
    font-size: 1.25rem;
    text-align: center;
    width: 60px;
}

/* Import button file input */
.import-file-input {
    display: none;
}

/* PDF download button */
.btn-pdf {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white;
}

.btn-pdf:hover:not(:disabled) {
    background-color: #991b1b;
}