/**
 * Profile Moondog - Frontend Styles
 * Based on the space-themed pet profile design
 */

/* ===== NOTIFICATIONS ===== */
.moondog-banner-notification {
    display: none;
    width: 100%;
    max-width: 600px;
    margin: 15px auto 20px auto;
    padding: 16px 24px;
    border-radius: 12px;
    color: #333;
    font-weight: 600;
    text-align: center;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.4s ease;
}

.moondog-banner-notification.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    border-color: rgba(16, 185, 129, 0.3);
    color: #064e3b;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.moondog-banner-notification.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.moondog-banner-notification.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.moondog-banner-notification.info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

/* ===== GENERAL STYLES ===== */
.moondog-pet-card {
    background: linear-gradient(180deg, #1e3a8a 0%, #1e3a8a 50%, #ff6b35 50%, #ff6b35 100%);
    border-radius: 15px;
    padding: 0;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    max-width: 400px;
    font-family: 'Arial', sans-serif;
}

/* Space background with stars */
.moondog-pet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff, transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    z-index: 1;
}

/* Rocket trail */
.moondog-pet-card::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 20"><path d="M5,10 Q15,5 25,10 Q35,15 45,10 Q55,5 60,10" stroke="%23ff6b35" stroke-width="2" fill="none" stroke-dasharray="5,5"/></svg>') no-repeat;
    z-index: 2;
}

/* ===== PET HEADER ===== */
.pet-header {
    position: relative;
    z-index: 3;
    padding: 20px;
    text-align: center;
}

.pet-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    margin: 0 auto 20px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.pet-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-photo {
    color: #ccc;
    font-size: 48px;
}

.pet-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}

.badge-text {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== PET INFO ===== */
.pet-info {
    background: #fff;
    padding: 25px;
    position: relative;
    z-index: 3;
}

.pet-name {
    font-size: 28px;
    font-weight: bold;
    color: #1e3a8a;
    text-transform: uppercase;
    margin: 0 0 15px 0;
    text-align: center;
    position: relative;
    z-index: 5;
    clear: both;
}

.pet-id {
    text-align: center;
    margin-bottom: 20px;
}

.id-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.id-number {
    font-size: 24px;
    font-weight: bold;
    color: #1e3a8a;
    font-family: 'Courier New', monospace;
}

.pet-details {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: #ff6b35;
    font-weight: 500;
    flex: 1;
}

.detail-value {
    font-size: 14px;
    color: #1e3a8a;
    font-weight: 600;
    flex: 1;
    text-align: right;
}

/* ===== PET POINTS ===== */
.pet-points {
    background: #fff;
    padding: 25px;
    border-top: 1px solid #eee;
}

.points-header h4 {
    font-size: 16px;
    color: #ff6b35;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.points-header p {
    font-size: 14px;
    color: #1e3a8a;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.points-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}


.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #1e3a8a;
    font-weight: 600;
}

.progress-start {
    text-align: left;
}

.progress-current {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #1e3a8a;
}

.progress-end {
    text-align: right;
}

/* ===== PET FOOTER ===== */
.pet-footer {
    background: #1e3a8a;
    padding: 15px;
    text-align: center;
}

.squadron-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.paw-icon {
    font-size: 16px;
}

.squadron-text {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== POINTS DISPLAY CARD ===== */
.moondog-points-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #ff6b35;
}

.points-header h3 {
    font-size: 24px;
    color: #1e3a8a;
    margin: 0 0 15px 0;
    text-align: center;
}

.total-points {
    text-align: center;
    margin-bottom: 25px;
}

.points-number {
    font-size: 48px;
    font-weight: bold;
    color: #ff6b35;
    display: block;
    line-height: 1;
}

.points-label {
    font-size: 16px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== POINTS HISTORY ===== */
.points-history {
    margin-top: 25px;
}

.points-history h4 {
    font-size: 18px;
    color: #1e3a8a;
    margin: 0 0 15px 0;
    border-bottom: 2px solid #ff6b35;
    padding-bottom: 5px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-description {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.history-points {
    font-size: 16px;
    font-weight: bold;
    margin: 0 15px;
}

.history-points.positive {
    color: #28a745;
}

.history-points.negative {
    color: #dc3545;
}

.history-date {
    font-size: 12px;
    color: #666;
    min-width: 80px;
    text-align: right;
}

/* ===== USER DASHBOARD ===== */
.moondog-dashboard {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

.dashboard-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.dashboard-tabs.vertical {
    flex-direction: column;
    width: 250px;
    float: left;
    min-height: 500px;
}

.dashboard-tabs.vertical + .dashboard-content {
    margin-left: 250px;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border-right: 1px solid #dee2e6;
    font-weight: 500;
}

.tab:last-child {
    border-right: none;
}

.tab:hover {
    background: #e9ecef;
}

.tab.active {
    background: #ff6b35;
    color: #fff;
}

.tab-icon {
    font-size: 18px;
}

.tab-title {
    font-size: 14px;
}

.dashboard-content {
    padding: 30px;
    min-height: 400px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== PETS GRID ===== */
.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pet-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.pet-card .pet-photo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
}

.pet-card .pet-info h4 {
    font-size: 20px;
    color: #1e3a8a;
    margin: 0 0 10px 0;
    text-align: center;
}

.pet-card .pet-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.pet-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pet-actions .button {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pet-actions .edit-pet {
    background: #ff6b35;
    color: #fff;
}

.pet-actions .edit-pet:hover {
    background: #e55a2b;
}

.pet-actions .delete-pet {
    background: #dc3545;
    color: #fff;
}

.pet-actions .delete-pet:hover {
    background: #c82333;
}

/* ===== FORMS ===== */
.moondog-form {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.moondog-form h3 {
    color: #1e3a8a;
    margin: 0 0 20px 0;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.button {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.button-primary {
    background: #ff6b35;
    color: #fff;
}

.button-primary:hover {
    background: #e55a2b;
}

.button-secondary {
    background: #6c757d;
    color: #fff;
}

.button-secondary:hover {
    background: #5a6268;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .moondog-pet-card {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .pet-photo {
        width: 100px;
        height: 100px;
        margin: 0 auto 25px;
        border-radius: 50%;
        overflow: hidden;
    }
    
    .pet-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }
    
    .pet-name {
        font-size: 24px;
        margin-top: 0;
        clear: both;
    }
    
    .points-number {
        font-size: 36px;
    }
    
    .dashboard-tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1 1 50%;
        min-width: 120px;
    }
    
    .dashboard-tabs.vertical {
        width: 100%;
        float: none;
    }
    
    .dashboard-tabs.vertical + .dashboard-content {
        margin-left: 0;
    }
    
    .pets-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pet-header {
        padding: 15px;
    }
    
    .pet-info {
        padding: 20px;
    }
    
    .pet-points {
        padding: 20px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .tab {
        padding: 12px 15px;
    }
    
    .tab-title {
        font-size: 12px;
    }
}

/* ===== UTILITY CLASSES ===== */
.moondog-not-logged-in,
.moondog-pet-not-found,
.moondog-no-pets {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.moondog-not-logged-in p,
.moondog-pet-not-found p,
.moondog-no-pets p {
    color: #666;
    font-size: 16px;
    margin: 0 0 20px 0;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ff6b35;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* ===== MODAL STYLES ===== */
body.modal-open {
    overflow: hidden;
}

.pet-loyalty-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
}

.modal-close:hover {
    color: #ff6b35;
    background: #fff;
    border-color: #ff6b35;
    transform: scale(1.1);
}

.modal-content h3 {
    color: #1e3a8a;
    margin: 0 0 25px 0;
    font-size: 24px;
    text-align: center;
    padding-right: 40px;
}

/* Form styles */
.form-fields {
    display: grid;
    gap: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.field-group input,
.field-group select,
.field-group textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.field-group textarea {
    resize: vertical;
    min-height: 80px;
}

.field-group input[type="file"] {
    padding: 8px;
    border: 2px dashed #e0e0e0;
    background: #f8f9fa;
    text-align: center;
}

.field-group input[type="file"]:hover {
    border-color: #ff6b35;
    background: #fff5f2;
}

#pet_photo_preview {
    text-align: center;
    margin-top: 10px;
}

#pet_photo_preview img {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.submit-button,
.cancel-button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.submit-button {
    background: #ff6b35;
    color: #fff;
}

.submit-button:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.cancel-button {
    background: #6c757d;
    color: #fff;
}

.cancel-button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Message styles */
.pet-loyalty-message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.pet-loyalty-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pet-loyalty-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pet-loyalty-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive modal */
@media (max-width: 768px) {
    .pet-loyalty-modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 20px;
        max-height: 95vh;
    }
    
    .modal-content h3 {
        font-size: 20px;
        padding-right: 30px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .submit-button,
    .cancel-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }
    
    .modal-content h3 {
        font-size: 18px;
    }
    
    .form-fields {
        gap: 15px;
    }
}

/* ===== BIRTHDAY FIELD STYLES ===== */
#birthday.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2) !important;
}

#birthday:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2) !important;
    outline: none !important;
}

#birthday::placeholder {
    color: #999;
    font-style: italic;
}
