/* Tailor Jotter Application Stylesheet */
/* Using Tailwind CSS utilities manually implemented */

/* CSS Variables for Theme - Tailor Jotter Brand */
:root {
    /* Brand Colors */
    --primary-color: #0D1B2A;
    --primary-dark: #051422;
    --primary-light: #1a2a3a;
    --accent-color: #D4A017;
    --accent-light: #E8B830;
    --teal-color: #0F766E;
    --cream-color: #F7F3E9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --text-primary: #0D1B2A;
    --text-secondary: #687280;
    --bg-primary: #ffffff;
    --bg-secondary: #F7F3E9;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(13, 27, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(13, 27, 42, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(13, 27, 42, 0.15);
}

/* Typography */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@400;500;600;700&display=swap');

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

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

h1 { font-size: 2.5rem; letter-spacing: -0.5px; }
h2 { font-size: 2rem; letter-spacing: -0.3px; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; font-family: 'Poppins', sans-serif; font-weight: 600; }
h6 { font-size: 0.875rem; font-family: 'Poppins', sans-serif; font-weight: 600; }

/* Mobile Responsive Typography */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
    
    body {
        font-size: 13px;
    }
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem 1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        border-radius: 0.5rem;
        max-height: 85vh;
    }

    .modal-header {
        margin-bottom: 1.5rem;
    }

    .modal-close {
        min-width: 32px;
        min-height: 32px;
    }
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-bottom: 3px solid var(--accent-color);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Playfair Display', serif;
}

.navbar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.navbar-brand span {
    color: var(--accent-color);
    letter-spacing: -0.5px;
}

.navbar-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.navbar-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.navbar-menu a:hover {
    color: var(--accent-color);
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.navbar-menu a:hover::after {
    width: 100%;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0.75rem 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
        gap: 0.5rem;
    }

    .navbar-brand img {
        width: 32px;
        height: 32px;
    }

    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .navbar-menu a {
        font-size: 0.875rem;
        padding: 0.5rem;
        display: block;
        text-align: center;
    }
}

/* Cards */
.card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border-left: 4px solid var(--primary-color);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-left-color: var(--accent-color);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

@media (max-width: 768px) {
    .form-control {
        padding: 0.875rem;
        font-size: 16px;
        min-height: 44px;
    }
    
    .form-label {
        font-size: 0.95rem;
    }
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.1);
}

.form-control:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-text.error {
    color: var(--danger-color);
}

select.form-control {
    cursor: pointer;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

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

.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-accent {
    background-color: var(--accent-color);
    color: white;
    border: 2px solid var(--accent-color);
    font-weight: 600;
}

.btn-accent:hover:not(:disabled) {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--gray-300);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-400);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group .btn {
        width: 100%;
        min-height: 44px;
    }
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

@media (max-width: 768px) {
    .table {
        font-size: 0.8rem;
    }

    .table th, .table td {
        padding: 0.5rem;
    }

    .table th {
        font-size: 0.75rem;
    }

    /* Responsive table: stack columns on mobile */
    .table tbody tr {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .table tbody td {
        border: none;
        padding: 0.5rem 0;
    }

    .table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        display: block;
        margin-bottom: 0.25rem;
    }
}

.table thead {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

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

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table-sm th,
.table-sm td {
    padding: 0.75rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    border-color: var(--danger-color);
    color: #7f1d1d;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: var(--warning-color);
    color: #78350f;
}

.alert-info {
    background-color: #dbeafe;
    border-color: var(--primary-color);
    color: #0c4a6e;
}

.alert-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Badges and Status */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef08a;
    color: #854d0e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-gray {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fef08a;
    color: #854d0e;
}

.status-in-progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-ready {
    background-color: #cffafe;
    color: #164e63;
}

.status-completed {
    background-color: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Grid and Flexbox */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .flex-between {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

.gap-6 {
    gap: 1.5rem;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

.gap-2 {
    gap: 0.5rem;
}

/* Spacing */
.m-0 { margin: 0; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.py-4 { padding: 1rem 0; }

/* Utilities */
.text-center {
    text-align: center;
}

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

.text-muted {
    color: var(--text-secondary);
}

.text-danger {
    color: var(--danger-color);
}

.text-success {
    color: var(--success-color);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.opacity-50 {
    opacity: 0.5;
}

.cursor-pointer {
    cursor: pointer;
}

.save-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    animation: fadeInOut 3s;
}

.save-indicator.saving {
    color: var(--warning-color);
}

.save-indicator.saved {
    color: var(--success-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInOut {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .card {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem 0.5rem;
    }
}
