/* ================================================
   MasterFeedback - Main Stylesheet
   ================================================ */

/* CSS Variables / Custom Properties */
:root {
    --primary-color: #005288;
    --primary-hover: #003d66;
    --primary-light: #e6f0f7;
    --button-color: #d11341;
    --button-hover: #a80f34;
    --star-color: #FBBF24;
    --star-hover: #F59E0B;
    --star-empty: #D1D5DB;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --bg-primary: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #E5E7EB 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 1rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Rating Card */
.rating-card {
    background: var(--bg-white);
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2rem;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rating Header */
.rating-header {
    margin-bottom: 2rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%;
    margin-bottom: 1.5rem;
    color: white;
}

.logo svg {
    width: 40px;
    height: 40px;
    fill: white;
    stroke: white;
}

.logo-img {
    margin-bottom: 1.5rem;
}

.logo-img img {
    max-width: 200px;
    height: auto;
}

.rating-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.rating-header .subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0 auto;
}

/* Rating Stars */
.rating-stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform var(--transition-fast);
    outline: none;
    border-radius: var(--radius-md);
}

.star:hover {
    transform: scale(1.15);
}

.star:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-light);
}

.star-icon {
    width: 48px;
    height: 48px;
    fill: var(--star-empty);
    stroke: var(--star-empty);
    stroke-width: 0.5;
    transition: all var(--transition-fast);
}

.star.hovered .star-icon,
.star.active .star-icon {
    fill: var(--star-color);
    stroke: var(--star-hover);
}

.star.active .star-icon {
    animation: starPop 0.3s ease;
}

@keyframes starPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Rating Labels */
.rating-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
    margin-bottom: 1.5rem;
}

.rating-labels span {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Rating Message */
.rating-message {
    min-height: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.rating-message.low {
    color: var(--warning-color);
}

.rating-message.high {
    color: var(--success-color);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--button-color);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    background: var(--button-hover);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.submit-btn .btn-loader {
    display: none;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    display: flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer - Hidden */
.footer {
    display: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-content p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ================================================
   Feedback Form Page Styles
   ================================================ */

.feedback-card {
    background: var(--bg-white);
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2rem;
    animation: fadeInUp 0.5s ease;
}

.feedback-header {
    text-align: center;
    margin-bottom: 2rem;
}

.feedback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    border-radius: 50%;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feedback-icon svg {
    width: 32px;
    height: 32px;
}

.feedback-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feedback-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.rating-display {
    display: inline-flex;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.rating-display .mini-star {
    width: 16px;
    height: 16px;
    fill: var(--star-empty);
}

.rating-display .mini-star.filled {
    fill: var(--star-color);
}

/* Form Styles */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label .optional {
    color: var(--text-light);
    font-weight: 400;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--error-color);
}

.error-message {
    font-size: 0.8rem;
    color: var(--error-color);
    display: none;
}

.error-message.visible {
    display: block;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-secondary {
    flex: 1;
    padding: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    text-align: center;
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-primary {
    flex: 2;
    padding: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: var(--button-color);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    background: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

.btn-primary .btn-loader {
    display: none;
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .btn-loader {
    display: flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ================================================
   Thank You Page Styles
   ================================================ */

.thankyou-card {
    background: var(--bg-white);
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    padding: 3rem 2rem;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success-color), #059669);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    color: white;
    animation: iconPop 0.5s ease 0.2s both;
}

@keyframes iconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon svg {
    width: 40px;
    height: 40px;
}

.thankyou-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.thankyou-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--primary-light);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-home:hover {
    background: var(--primary-color);
    color: white;
}

.btn-home svg {
    width: 18px;
    height: 18px;
}

/* ================================================
   Admin Panel Styles
   ================================================ */

.admin-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-header h1 svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-logout:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.btn-logout svg {
    width: 16px;
    height: 16px;
}

/* Admin Cards */
.admin-grid {
    display: grid;
    gap: 1.5rem;
}

.admin-card {
    background: var(--bg-white);
    border-radius: 0;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.admin-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-card h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

/* Settings Form */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-form .form-group {
    gap: 0.375rem;
}

.settings-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-form .hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.settings-form input {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.btn-save {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    margin-bottom: 1rem;
}

.alert.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
    display: block;
}

.alert.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    display: block;
}

/* Feedback Table */
.feedback-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.feedback-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.feedback-table th,
.feedback-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.feedback-table th {
    background: var(--bg-primary);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.feedback-table td {
    color: var(--text-secondary);
}

.feedback-table tr:hover td {
    background: var(--bg-primary);
}

.feedback-table .rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--star-color);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
}

.feedback-table .rating-badge svg {
    width: 12px;
    height: 12px;
    fill: white;
}

.feedback-table .message-preview {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-feedback {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-feedback svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Login Page */
.login-card {
    background: var(--bg-white);
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 0.75rem;
    }
    
    .rating-card,
    .feedback-card,
    .thankyou-card {
        padding: 2rem 1.5rem;
    }
    
    .rating-header h1 {
        font-size: 1.5rem;
    }
    
    .star-icon {
        width: 40px;
        height: 40px;
    }
    
    .star {
        padding: 0.35rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-secondary,
    .btn-primary {
        flex: 1;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .feedback-table {
        font-size: 0.8rem;
    }
    
    .feedback-table th,
    .feedback-table td {
        padding: 0.625rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 64px;
        height: 64px;
    }
    
    .logo svg {
        width: 32px;
        height: 32px;
    }
    
    .rating-header h1 {
        font-size: 1.35rem;
    }
    
    .rating-header .subtitle {
        font-size: 0.9rem;
    }
    
    .star-icon {
        width: 36px;
        height: 36px;
    }
    
    .rating-stars {
        gap: 0.25rem;
    }
}
