/**
 * ISY Prompt Portal - Main Stylesheet
 * Theme: Gold/Yellow based on ISY branding
 */

:root {
    --isy-gold: #D4A017;
    --isy-gold-dark: #B8860B;
    --isy-gold-light: #FFD700;
    --isy-gold-lighter: #FFF8DC;
    --color-primary: #D4A017;
    --color-primary-dark: #B8860B;
    --color-primary-light: #FFD700;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;
    --color-text: #333;
    --color-text-light: #666;
    --color-text-muted: #999;
    --color-border: #ddd;
    --color-bg: #f5f5f5;
    --color-bg-light: #fafafa;
    --color-white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Navigation */
.header {
    background: linear-gradient(135deg, var(--isy-gold-light) 0%, var(--isy-gold) 100%);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.header-logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.2);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.user-info {
    color: white;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-email {
    font-size: 12px;
    opacity: 0.9;
}

.admin-badge {
    background: white;
    color: var(--isy-gold);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
    border-color: white;
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 32px;
    color: var(--isy-gold-dark);
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--color-text-light);
    font-size: 16px;
}

/* Search and Filter Section */
.search-filter-section {
    background: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--isy-gold);
}

.search-btn {
    background: var(--isy-gold);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--isy-gold-dark);
}

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

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--color-text);
    font-size: 14px;
}

.filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

.filter-select:focus {
    outline: none;
    border-color: var(--isy-gold);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--isy-gold);
    color: white;
}

.btn-primary:hover {
    background: var(--isy-gold-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px 12px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 20px;
    color: var(--isy-gold-dark);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: var(--color-bg-light);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Prompt Grid */
.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.prompt-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    border: 2px solid transparent;
}

.prompt-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--isy-gold-light);
}

.prompt-card-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--isy-gold-lighter) 0%, white 100%);
}

.prompt-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--isy-gold-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.prompt-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--color-text-light);
}

.prompt-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.prompt-card-body {
    padding: 20px;
}

.prompt-content {
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.prompt-content.expanded {
    max-height: none;
}

.prompt-content-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, white);
}

.prompt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: var(--isy-gold-lighter);
    color: var(--isy-gold-dark);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.prompt-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-light);
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
}

.author-date {
    font-size: 12px;
    color: var(--color-text-light);
}

.prompt-actions {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--color-border);
}

.action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn-copy {
    background: var(--isy-gold);
    color: white;
}

.action-btn-copy:hover {
    background: var(--isy-gold-dark);
}

.action-btn-view {
    background: var(--color-bg);
    color: var(--color-text);
}

.action-btn-view:hover {
    background: #e8e8e8;
}

/* Forms */
.form-container {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 800px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 14px;
}

.form-group label .required {
    color: var(--color-danger);
    margin-left: 3px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--isy-gold);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--color-text-light);
}

.form-error {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 5px;
}

/* Tag Input */
.tag-input-container {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: var(--transition);
}

.tag-input-container:focus-within {
    border-color: var(--isy-gold);
}

.tag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    padding: 4px;
    font-size: 14px;
}

.tag-item {
    background: var(--isy-gold);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--isy-gold-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-text-light);
    line-height: 1;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 90px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.error {
    border-left: 4px solid var(--color-danger);
}

.toast.warning {
    border-left: 4px solid var(--color-warning);
}

.toast.info {
    border-left: 4px solid var(--color-info);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--color-border);
    border-top: 4px solid var(--isy-gold);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 24px;
    color: var(--color-text-light);
    margin-bottom: 10px;
}

.empty-state-text {
    color: var(--color-text-muted);
    margin-bottom: 25px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .search-bar {
        flex-direction: column;
    }

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

    .form-container {
        padding: 25px;
    }

    .page-title {
        font-size: 24px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.hidden { display: none; }
