/* GemCertify Global Styles */

:root {
    /* Brand Colors */
    --primary: #1791cf;
    --background-light: #f6f7f8;
    --background-dark: #111c21;
    --foreground-light: #111518;
    --foreground-dark: #f6f7f8;
    --card-light: #ffffff;
    --card-dark: #1a2730;
    --border-light: #dce0e5;
    --border-dark: #2a3b47;
    --muted-light: #60778a;
    --muted-dark: #9cb3c9;
    --subtle-light: #9cb3c9;
    --subtle-dark: #60778a;
}

/* Custom Form Input Styles */
.form-input::placeholder {
    color: #9ca3af;
}

.form-input:focus {
    --tw-ring-color: transparent;
}

/* Draggable Field Styles (for template editor) */
.draggable-field {
    position: absolute;
    cursor: move;
    border: 2px dashed;
    padding: 0.5rem;
    user-select: none;
    background-color: rgba(23, 145, 207, 0.1);
}

/* Certificate Table Hover Effects */
.certificate-row {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.certificate-row:hover {
    background-color: rgba(23, 145, 207, 0.05);
}

.dark .certificate-row:hover {
    background-color: rgba(23, 145, 207, 0.1);
}

/* Preview Thumbnail Animation */
.preview-thumbnail {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 50;
}

.certificate-row:hover .preview-thumbnail {
    opacity: 1;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(23, 145, 207, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 0.8s linear infinite;
}

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

/* Button Hover Effects */
.btn-primary {
    background-color: var(--primary);
    color: white;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: rgba(23, 145, 207, 0.1);
    color: var(--primary);
    transition: background-color 0.2s ease;
}

.dark .btn-secondary {
    background-color: rgba(23, 145, 207, 0.2);
}

.btn-secondary:hover {
    background-color: rgba(23, 145, 207, 0.2);
}

.dark .btn-secondary:hover {
    background-color: rgba(23, 145, 207, 0.3);
}

/* Photo Gallery Grid */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--border-light);
    transition: border-color 0.2s ease;
}

.dark .photo-item {
    border-color: var(--border-dark);
}

.photo-item:hover {
    border-color: var(--primary);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #0a0;
    border: 1px solid #cfc;
}

.alert-info {
    background-color: rgba(23, 145, 207, 0.1);
    color: var(--primary);
    border: 1px solid rgba(23, 145, 207, 0.3);
}

/* Dark Mode Alert Styles */
.dark .alert-error {
    background-color: rgba(200, 0, 0, 0.2);
    color: #fcc;
}

.dark .alert-success {
    background-color: rgba(0, 170, 0, 0.2);
    color: #cfc;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: var(--background-light);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    border-bottom: 2px solid var(--border-light);
}

.dark .data-table th {
    background-color: rgba(26, 39, 48, 0.5);
    border-bottom-color: var(--border-dark);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.dark .data-table td {
    border-bottom-color: var(--border-dark);
}

/* Form Validation */
.form-error {
    border-color: #f00 !important;
}

.error-message {
    color: #c00;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.dark .error-message {
    color: #fcc;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }
    
    .nav-mobile {
        display: flex;
    }
}

@media (min-width: 769px) {
    .nav-desktop {
        display: flex;
    }
    
    .nav-mobile {
        display: none;
    }
}
