/* Tickets Interface - Beceiro.es */

:root {
    --primary-red: #C41E3A;
    --primary-red-dark: #8B1538;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-900: #212121;
    --white: #FFFFFF;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--gray-900);
}

.tickets-container {
    max-width: 900px;
    margin: 0 auto;
}

.tickets-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.back-link {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-red);
}

.header-logo img {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.tickets-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Search Section */
.search-section {
    display: flex;
    justify-content: center;
}

.search-card {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    width: 100%;
    max-width: 500px;
}

.search-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(196, 30, 58, 0.1);
    border-radius: 50%;
    color: var(--primary-red);
    font-size: 2.5rem;
}

.search-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-align: center;
}

.search-card p {
    color: var(--gray-600);
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-message {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-red);
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-with-prefix:focus-within {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.input-prefix {
    padding: 0.875rem 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    border-right: 1px solid var(--gray-300);
}

.input-with-prefix input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    outline: none;
}

.form-group input[type="email"] {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.search-button {
    padding: 1rem 2rem;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--font-primary);
}

.search-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

/* Ticket View */
.ticket-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ticket-header-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.ticket-number-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.ticket-number-badge i {
    font-size: 1.5rem;
    color: var(--primary-red);
}

.ticket-number-badge span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    letter-spacing: 1px;
}

.status-badge {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.detail-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-900);
}

.detail-card h3 i {
    color: var(--primary-red);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.priority-urgent {
    color: #ef4444;
}

.priority-high {
    color: #f59e0b;
}

.priority-medium {
    color: #2563eb;
}

.message-content {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: 12px;
    line-height: 1.8;
    color: var(--gray-700);
    white-space: pre-wrap;
}

.attachments-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.attachments-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.attachment-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    aspect-ratio: 1;
}

.attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.attachment-item img:hover {
    transform: scale(1.05);
}

.responses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.response-item {
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.response-item.admin-response {
    background: rgba(196, 30, 58, 0.05);
    border-color: var(--primary-red);
}

.response-item.user-response {
    background: var(--gray-50);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.response-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.response-author i {
    color: var(--primary-red);
}

.response-date {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.response-content {
    line-height: 1.8;
    color: var(--gray-700);
    white-space: pre-wrap;
}

.response-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.response-form textarea {
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.response-form textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.submit-response-button {
    padding: 1rem 2rem;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--font-primary);
    align-self: flex-start;
}

.submit-response-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .tickets-header h1 {
        font-size: 1.5rem;
    }
    
    .back-link {
        position: relative;
        margin-bottom: 1rem;
    }
    
    .search-card {
        padding: 2rem 1.5rem;
    }
    
    .ticket-header-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
