/* Mobile-First Responsive CSS for SmartCRM */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Responsive Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header and Navigation */
.header {
    background: #667eea;
    color: white;
    padding: 1rem;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav a, .nav span {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    transition: background 0.3s;
    font-size: 0.9rem;
}

.nav a:hover, .nav a.active {
    background: rgba(255,255,255,0.2);
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Landing Page Styles */
.landing-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
    margin: 2rem auto;
}

.landing-logo {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
    font-weight: bold;
}

.welcome-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.landing-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.features {
    margin-top: 2rem;
    text-align: left;
}

.feature {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.feature-title {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* Form Styles */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
    margin: 2rem auto;
}

.form-logo {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 2rem;
    font-weight: bold;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: bold;
    font-size: 0.9rem;
}

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
input[type="date"], 
select, 
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    margin: 0.25rem;
    min-width: 120px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-full {
    width: 100%;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.card h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
    font-size: 1.5rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 1rem;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-section h1 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
}

.welcome-section p {
    font-size: 1.1rem;
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

.table th {
    background: #f8f9fa;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Mobile Table Cards */
.mobile-cards {
    display: none;
}

.mobile-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-card-header {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-card-row:last-child {
    border-bottom: none;
    margin-bottom: 1rem;
}

.mobile-card-label {
    font-weight: bold;
    color: #666;
}

.mobile-card-value {
    color: #333;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mobile-card-actions .btn {
    flex: 1;
    min-width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #f8d7da;
    color: #721c24;
}

.amount {
    font-weight: bold;
    color: #28a745;
}

/* Company Header */
.company-header {
    background: #e9ecef;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.company-header h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.company-header p {
    margin: 0 0 1rem 0;
    color: #666;
}

/* Links */
.links {
    text-align: center;
    margin-top: 1.5rem;
}

.links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 0.5rem;
    font-size: 0.9rem;
}

.links a:hover {
    text-decoration: underline;
}

/* Password Requirements */
.password-requirements {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Responsive Breakpoints */

/* Tablet Styles */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    .header {
        padding: 0.75rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logo {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .nav {
        width: 100%;
        justify-content: space-between;
        gap: 0.25rem;
    }
    
    .nav a, .nav span {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .welcome-section {
        padding: 1.5rem;
    }
    
    .welcome-section h1 {
        font-size: 1.5rem;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: auto;
    }
    
    .landing-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
    }
}

/* Mobile Styles */
@media (max-width: 480px) {
    .container {
        padding: 0.25rem;
    }
    
    .header {
        padding: 0.5rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #667eea;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav a, .nav span {
        padding: 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
        text-align: left;
    }
    
    .nav a:last-child, .nav span:last-child {
        border-bottom: none;
    }
    
    .mobile-nav-toggle {
        display: block;
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .header-content {
        position: relative;
        width: 100%;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card h2 {
        font-size: 1.2rem;
    }
    
    .form-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    .form-logo {
        font-size: 2rem;
    }
    
    .landing-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    .landing-logo {
        font-size: 2rem;
    }
    
    .welcome-text {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .welcome-section {
        padding: 1rem;
    }
    
    .welcome-section h1 {
        font-size: 1.3rem;
    }
    
    .welcome-section p {
        font-size: 1rem;
    }
    
    /* Hide desktop tables, show mobile cards */
    .table-container {
        display: none;
    }
    
    .mobile-cards {
        display: block;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-width: auto;
    }
    
    .mobile-card-actions .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Very Small Mobile Styles */
@media (max-width: 320px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container, .landing-container {
        width: 95%;
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .mobile-card {
        padding: 0.75rem;
    }
    
    .mobile-card-actions {
        flex-direction: column;
    }
    
    .mobile-card-actions .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
}

/* Print Styles */
@media print {
    .header, .mobile-nav-toggle, .btn, .actions {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}
